Improve pyrepl type-annotation coverage (#119081)

This commit is contained in:
Alex Waygood 2024-05-17 06:13:24 -04:00 committed by GitHub
parent 100c7ab00a
commit 033f5c87f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 31 additions and 14 deletions

View file

@ -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: