diff --git a/stdlib/_curses.pyi b/stdlib/_curses.pyi index 61881fc09199..a4fd949665b3 100644 --- a/stdlib/_curses.pyi +++ b/stdlib/_curses.pyi @@ -366,7 +366,10 @@ if sys.platform != "win32": ) -> bytes: ... def typeahead(__fd: int) -> None: ... def unctrl(__ch: _ChType) -> bytes: ... - def unget_wch(__ch: int | str) -> None: ... + if sys.version_info < (3, 12) or sys.platform != "darwin": + # The support for macos was dropped in 3.12 + def unget_wch(__ch: int | str) -> None: ... + def ungetch(__ch: _ChType) -> None: ... def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ... def update_lines_cols() -> None: ... @@ -441,10 +444,13 @@ if sys.platform != "win32": def getch(self) -> int: ... @overload def getch(self, y: int, x: int) -> int: ... - @overload - def get_wch(self) -> int | str: ... - @overload - def get_wch(self, y: int, x: int) -> int | str: ... + if sys.version_info < (3, 12) or sys.platform != "darwin": + # The support for macos was dropped in 3.12 + @overload + def get_wch(self) -> int | str: ... + @overload + def get_wch(self, y: int, x: int) -> int | str: ... + @overload def getkey(self) -> str: ... @overload diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt index 1d424177d79c..96d02b2066fd 100644 --- a/tests/stubtest_allowlists/darwin-py312.txt +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -1,9 +1,5 @@ _?curses.color_pair -_curses.unget_wch -_curses.window.get_wch _posixsubprocess.fork_exec -curses.unget_wch -curses.window.get_wch (dbm.gnu)? (locale.bind_textdomain_codeset)?