mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Improve pyrepl
type-annotation coverage (#119081)
This commit is contained in:
parent
100c7ab00a
commit
033f5c87f1
6 changed files with 31 additions and 14 deletions
|
@ -76,10 +76,14 @@ def tty_pager(text: str, title: str = '') -> None:
|
|||
fd = sys.stdin.fileno()
|
||||
old = termios.tcgetattr(fd)
|
||||
tty.setcbreak(fd)
|
||||
getchar = lambda: sys.stdin.read(1)
|
||||
has_tty = True
|
||||
|
||||
def getchar() -> str:
|
||||
return sys.stdin.read(1)
|
||||
|
||||
except (ImportError, AttributeError, io.UnsupportedOperation):
|
||||
getchar = lambda: sys.stdin.readline()[:-1][:1]
|
||||
def getchar() -> str:
|
||||
return sys.stdin.readline()[:-1][:1]
|
||||
|
||||
try:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue