]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44321: Adds `os.EX_OK` for Windows (GH-26559)
authorSamuel Marks <807580+SamuelMarks@users.noreply.github.com>
Thu, 24 Jun 2021 16:45:18 +0000 (02:45 +1000)
committerGitHub <noreply@github.com>
Thu, 24 Jun 2021 16:45:18 +0000 (17:45 +0100)
Doc/library/os.rst
Modules/posixmodule.c

index 4b249ed92c3588e0988bd665d3493e2a19bbf205..d3ca8c0476d0c561c7123227e9a6b6ae741efc11 100644 (file)
@@ -3656,9 +3656,10 @@ written in Python, such as a mail server's external command delivery program.
 
 .. data:: EX_OK
 
-   Exit code that means no error occurred.
+   Exit code that means no error occurred. May be taken from the defined value of
+   ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero.
 
-   .. availability:: Unix.
+   .. availability:: Unix, Windows.
 
 
 .. data:: EX_USAGE
index 25ddc82cb893ab33660e575a48e9e0352323c581..73e7e60fe63ff45b79e27b1d2d9890d81f435429 100644 (file)
 #  include <pathcch.h>
 #endif
 
+#if !defined(EX_OK) && defined(EXIT_SUCCESS)
+#define EX_OK EXIT_SUCCESS
+#endif
+
 #ifdef __VXWORKS__
 #  include "pycore_bitutils.h"    // _Py_popcount32()
 #endif