From a7702164349776ebf25e2c1e0a0c123333a5b68f Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 4 Jun 2023 16:10:15 -0700 Subject: [PATCH] Make stubtest work better on macOS (#10263) --- stdlib/fcntl.pyi | 5 +++-- tests/stubtest_allowlists/darwin-py311.txt | 2 +- tests/stubtest_allowlists/darwin-py312.txt | 2 +- tests/stubtest_allowlists/darwin.txt | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/stdlib/fcntl.pyi b/stdlib/fcntl.pyi index 01443083f..6aec7515f 100644 --- a/stdlib/fcntl.pyi +++ b/stdlib/fcntl.pyi @@ -20,6 +20,9 @@ if sys.platform != "win32": F_SETOWN: int F_UNLCK: int F_WRLCK: int + + F_GETLEASE: int + F_SETLEASE: int if sys.platform == "darwin": F_FULLFSYNC: int F_NOCACHE: int @@ -30,11 +33,9 @@ if sys.platform != "win32": F_SETSIG: int F_SHLCK: int F_SETLK64: int - F_SETLEASE: int F_GETSIG: int F_NOTIFY: int F_EXLCK: int - F_GETLEASE: int F_GETLK64: int if sys.version_info >= (3, 8): F_ADD_SEALS: int diff --git a/tests/stubtest_allowlists/darwin-py311.txt b/tests/stubtest_allowlists/darwin-py311.txt index 388f1d9b1..da55c1878 100644 --- a/tests/stubtest_allowlists/darwin-py311.txt +++ b/tests/stubtest_allowlists/darwin-py311.txt @@ -7,7 +7,7 @@ socket.TCP_CONNECTION_INFO (dbm.gnu)? (locale.bind_textdomain_codeset)? (locale.bindtextdomain)? -(locale.dcgettext) +(locale.dcgettext)? (locale.dgettext)? (locale.gettext)? (locale.textdomain)? diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt index 73a929a68..e9427d189 100644 --- a/tests/stubtest_allowlists/darwin-py312.txt +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -43,7 +43,7 @@ xxlimited.Xxo.x_exports (dbm.gnu)? (locale.bind_textdomain_codeset)? (locale.bindtextdomain)? -(locale.dcgettext) +(locale.dcgettext)? (locale.dgettext)? (locale.gettext)? (locale.textdomain)? diff --git a/tests/stubtest_allowlists/darwin.txt b/tests/stubtest_allowlists/darwin.txt index 09333f3fa..b13f16ba1 100644 --- a/tests/stubtest_allowlists/darwin.txt +++ b/tests/stubtest_allowlists/darwin.txt @@ -7,7 +7,6 @@ os.SF_NODISKIO os.SF_SYNC (os|posix).sched_param # system dependent. Unclear if macos has it. posix.EX_NOTFOUND -readline.append_history_file # not defined in macos select.KQ_FILTER_NETDEV # system dependent select.kqueue.__init__ # default C signature is wrong select.POLLMSG # system dependent @@ -20,6 +19,9 @@ select.POLLMSG # system dependent (os.pwritev)? (posix.preadv)? (posix.pwritev)? +(readline.append_history_file)? +(fcntl.F_GETLEASE)? +(fcntl.F_SETLEASE)? # Platform differences that cannot be captured by the type system (posix.O_[A-Z_]+)?