Skip to content

bpo-44321: Added os.EX_OK for Windows#26559

Merged
zooba merged 4 commits into
python:mainfrom
SamuelMarks:win-exok
Jun 24, 2021
Merged

bpo-44321: Added os.EX_OK for Windows#26559
zooba merged 4 commits into
python:mainfrom
SamuelMarks:win-exok

Conversation

@SamuelMarks
Copy link
Copy Markdown
Contributor

@SamuelMarks SamuelMarks commented Jun 6, 2021

[Modules/posixmodule.c] Added os.EX_OK for Windows; [Doc/library/os.rst] Reflect Windows os.EX_OK support in doc

EXIT_SUCCESS is defined in stdlib.h, as per https://docs.microsoft.com/en-us/cpp/c-runtime-library/exit-success-exit-failure (following the standard https://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdlib.h.html)

Since Python 2.3 alpha 2 [19-Feb-2003] EX_OK has existed… but only for Unix. This adds support for Windows.

There are also https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-constants which has many equivalents to the <sysexits.h> (in <errno.h>).

Kinda related: https://bugs.python.org/issue24053

https://bugs.python.org/issue44321

….rst] Reflect Windows `os.EX_OK` support in doc
Copy link
Copy Markdown
Member

@zooba zooba left a comment

Choose a reason for hiding this comment

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

Should also add a versionchanged attribute to the docs saying that using EXIT_SUCCESS when EX_OK is not defined was added in 3.11.

Comment thread Modules/posixmodule.c
Comment thread Doc/library/os.rst Outdated
SamuelMarks and others added 2 commits June 8, 2021 16:58
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Comment thread Doc/library/os.rst Outdated
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
@zooba zooba merged commit 19459f8 into python:main Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants