From 6dfa2852300ed610b93dbf1455fe628d394a1207 Mon Sep 17 00:00:00 2001 From: Amin Alaee Date: Fri, 22 Sep 2023 13:51:22 +0200 Subject: [PATCH] Add os.EX_OK on Windows, Python 3.11+ (#10748) --- stdlib/os/__init__.pyi | 4 +++- tests/stubtest_allowlists/win32-py311.txt | 1 - tests/stubtest_allowlists/win32-py312.txt | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 961858ce3..f3424b480 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -252,12 +252,14 @@ environ: _Environ[str] if sys.platform != "win32": environb: _Environ[bytes] +if sys.version_info >= (3, 11) or sys.platform != "win32": + EX_OK: int + if sys.platform != "win32": confstr_names: dict[str, int] pathconf_names: dict[str, int] sysconf_names: dict[str, int] - EX_OK: int EX_USAGE: int EX_DATAERR: int EX_NOINPUT: int diff --git a/tests/stubtest_allowlists/win32-py311.txt b/tests/stubtest_allowlists/win32-py311.txt index 4721e015d..3e0b0f023 100644 --- a/tests/stubtest_allowlists/win32-py311.txt +++ b/tests/stubtest_allowlists/win32-py311.txt @@ -2,7 +2,6 @@ asyncio.IocpProactor.recvfrom_into asyncio.windows_events.IocpProactor.recvfrom_into msvcrt.GetErrorMode -os.EX_OK # pathlib methods that exist on Windows, but always raise NotImplementedError, # so are omitted from the stub diff --git a/tests/stubtest_allowlists/win32-py312.txt b/tests/stubtest_allowlists/win32-py312.txt index 2012b686b..7df0faeaa 100644 --- a/tests/stubtest_allowlists/win32-py312.txt +++ b/tests/stubtest_allowlists/win32-py312.txt @@ -5,7 +5,6 @@ asyncio.windows_events.IocpProactor.finish_socket_func asyncio.windows_events.IocpProactor.recvfrom_into msvcrt.GetErrorMode ntpath.isdir -os.EX_OK os.get_blocking os.listdrives os.listmounts