From 1a8c7ebe375661ba63187d313a66b13c383906c2 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 27 Jul 2024 11:36:08 +0300 Subject: [PATCH] `HAVE_NCURSESW` is present on macos (#12441) --- .../@tests/stubtest_allowlists/darwin-py312.txt | 5 ----- .../@tests/stubtest_allowlists/darwin-py313.txt | 5 +++++ stdlib/_curses.pyi | 17 +++++------------ 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py312.txt b/stdlib/@tests/stubtest_allowlists/darwin-py312.txt index 00571207c..10b3f11ee 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py312.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py312.txt @@ -1,10 +1,5 @@ webbrowser.MacOSX.__init__ -# TODO: fix -_curses.unget_wch -_curses.window.get_wch -curses.window.get_wch - # These entries looks like a `setup-python` bug: (dbm.gnu)? (_?locale.bind_textdomain_codeset)? diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt index 76105864b..b58da34e1 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt @@ -1,6 +1,11 @@ # new in py313 posixpath.splitroot +# Depends on HAVE_NCURSESW and how we install CPython, +# should be removed when 3.13 will be officially released: +_?curses.unget_wch +_?curses.window.get_wch + # Exists locally on MacOS but not on GitHub (mmap.MAP_32BIT)? diff --git a/stdlib/_curses.pyi b/stdlib/_curses.pyi index eb1d7b9bd..505637574 100644 --- a/stdlib/_curses.pyi +++ b/stdlib/_curses.pyi @@ -368,11 +368,7 @@ def tparm( ) -> bytes: ... def typeahead(fd: int, /) -> None: ... def unctrl(ch: _ChType, /) -> bytes: ... - -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 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: ... @@ -447,13 +443,10 @@ class _CursesWindow: def getch(self) -> int: ... @overload def getch(self, y: int, x: int) -> int: ... - 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 get_wch(self) -> int | str: ... + @overload + def get_wch(self, y: int, x: int) -> int | str: ... @overload def getkey(self) -> str: ... @overload