Skip to content

Commit 19459f8

Browse files
authored
bpo-44321: Adds os.EX_OK for Windows (pythonGH-26559)
1 parent 0acc258 commit 19459f8

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Doc/library/os.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,9 +3656,10 @@ written in Python, such as a mail server's external command delivery program.
36563656

36573657
.. data:: EX_OK
36583658

3659-
Exit code that means no error occurred.
3659+
Exit code that means no error occurred. May be taken from the defined value of
3660+
``EXIT_SUCCESS`` on some platforms. Generally has a value of zero.
36603661

3661-
.. availability:: Unix.
3662+
.. availability:: Unix, Windows.
36623663

36633664

36643665
.. data:: EX_USAGE

Modules/posixmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
# include <pathcch.h>
2424
#endif
2525

26+
#if !defined(EX_OK) && defined(EXIT_SUCCESS)
27+
#define EX_OK EXIT_SUCCESS
28+
#endif
29+
2630
#ifdef __VXWORKS__
2731
# include "pycore_bitutils.h" // _Py_popcount32()
2832
#endif

0 commit comments

Comments
 (0)