mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
[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:
parent
bfd9c3ea53
commit
cd39da75af
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