Update tty to python 3.12 (#10784)

This commit is contained in:
Nikita Sobolev
2023-09-27 12:15:32 +03:00
committed by GitHub
parent ec52bf1add
commit 4dad5311d5
3 changed files with 10 additions and 7 deletions

View File

@@ -1,9 +1,11 @@
import sys
from typing import IO
from typing import IO, Any
from typing_extensions import TypeAlias
if sys.platform != "win32":
__all__ = ["setraw", "setcbreak"]
if sys.version_info >= (3, 12):
__all__ += ["cfmakeraw", "cfmakecbreak"]
_FD: TypeAlias = int | IO[str]
@@ -17,3 +19,10 @@ if sys.platform != "win32":
CC: int
def setraw(fd: _FD, when: int = 2) -> None: ...
def setcbreak(fd: _FD, when: int = 2) -> None: ...
if sys.version_info >= (3, 12):
# It is: `list[int, int, int, int, int, int, list[str]]
_Mode: TypeAlias = list[Any]
def cfmakeraw(mode: _Mode) -> None: ...
def cfmakecbreak(mode: _Mode) -> None: ...

View File

@@ -4,9 +4,6 @@ _curses.window.get_wch
_posixsubprocess.fork_exec
curses.unget_wch
curses.window.get_wch
tty.__all__
tty.cfmakecbreak
tty.cfmakeraw
xxlimited.Xxo.x_exports
(dbm.gnu)?

View File

@@ -8,9 +8,6 @@ mmap.MAP_STACK
resource.prlimit
signal.sigtimedwait
signal.sigwaitinfo
tty.__all__
tty.cfmakecbreak
tty.cfmakeraw
xxlimited.Xxo.x_exports
# Exists on some Linux builds, and is documented,