Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Lib/tty.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Author: Steen Lumholt.

from termios import *
from termios import TCSAFLUSH, tcgetattr, tcsetattr, BRKINT, ICRNL, INPCK, ISTRIP, IXON, VMIN, VTIME, CS8, OPOST, CSIZE, PARENB, ECHO, ICANON, IEXTEN, ISIG

__all__ = ["setraw", "setcbreak"]

Expand All @@ -15,7 +15,7 @@
OSPEED = 5
CC = 6

def setraw(fd, when=TCSAFLUSH):
def setraw(fd, when: int = TCSAFLUSH):
"""Put terminal into a raw mode."""
mode = tcgetattr(fd)
mode[IFLAG] = mode[IFLAG] & ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON)
Expand All @@ -27,7 +27,7 @@ def setraw(fd, when=TCSAFLUSH):
mode[CC][VTIME] = 0
tcsetattr(fd, when, mode)

def setcbreak(fd, when=TCSAFLUSH):
def setcbreak(fd, when: int = TCSAFLUSH):
"""Put terminal into a cbreak mode."""
mode = tcgetattr(fd)
mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON)
Expand Down