Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add os.EX_OK for Python 3.11 #10748

Merged
merged 4 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/stubtest_allowlists/win32-py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/stubtest_allowlists/win32-py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines 8 to 10
Copy link
Member

@AlexWaygood AlexWaygood Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a bunch of functions were added to the os module on Windows in Python 3.12, that we haven't added yet in typeshed. If you fancy tackling that in a followup PR, it would be really valuable!

Much like os.EX_OK, it looks like at least some of them already existed on other platforms:

def get_blocking(__fd: int) -> bool: ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sure, I'd love to.

Expand Down