[3.13] Improve pyrepl type-annotation coverage (GH-119081) (#119415)

(cherry picked from commit 033f5c87f1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-05-22 20:38:32 +02:00 committed by GitHub
parent bfd9c3ea53
commit cd39da75af
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: