Skip to content

Commit 4c5d3e5

Browse files
authored
Some curses functions were removed in 3.12 for macos (#10808)
1 parent 398b31d commit 4c5d3e5

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

stdlib/_curses.pyi

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,10 @@ if sys.platform != "win32":
366366
) -> bytes: ...
367367
def typeahead(__fd: int) -> None: ...
368368
def unctrl(__ch: _ChType) -> bytes: ...
369-
def unget_wch(__ch: int | str) -> None: ...
369+
if sys.version_info < (3, 12) or sys.platform != "darwin":
370+
# The support for macos was dropped in 3.12
371+
def unget_wch(__ch: int | str) -> None: ...
372+
370373
def ungetch(__ch: _ChType) -> None: ...
371374
def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ...
372375
def update_lines_cols() -> None: ...
@@ -441,10 +444,13 @@ if sys.platform != "win32":
441444
def getch(self) -> int: ...
442445
@overload
443446
def getch(self, y: int, x: int) -> int: ...
444-
@overload
445-
def get_wch(self) -> int | str: ...
446-
@overload
447-
def get_wch(self, y: int, x: int) -> int | str: ...
447+
if sys.version_info < (3, 12) or sys.platform != "darwin":
448+
# The support for macos was dropped in 3.12
449+
@overload
450+
def get_wch(self) -> int | str: ...
451+
@overload
452+
def get_wch(self, y: int, x: int) -> int | str: ...
453+
448454
@overload
449455
def getkey(self) -> str: ...
450456
@overload

tests/stubtest_allowlists/darwin-py312.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
_?curses.color_pair
2-
_curses.unget_wch
3-
_curses.window.get_wch
42
_posixsubprocess.fork_exec
5-
curses.unget_wch
6-
curses.window.get_wch
73

84
(dbm.gnu)?
95
(locale.bind_textdomain_codeset)?

0 commit comments

Comments
 (0)