From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Thu, 24 Jun 2021 16:45:18 +0000 (+1000) Subject: bpo-44321: Adds `os.EX_OK` for Windows (GH-26559) X-Git-Tag: v3.11.0a1~785 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=19459f8ce63cc7f905e3c1a55d09d4d10d245343;p=thirdparty%2FPython%2Fcpython.git bpo-44321: Adds `os.EX_OK` for Windows (GH-26559) --- diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 4b249ed92c35..d3ca8c0476d0 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -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 diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 25ddc82cb893..73e7e60fe63f 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -23,6 +23,10 @@ # include #endif +#if !defined(EX_OK) && defined(EXIT_SUCCESS) +#define EX_OK EXIT_SUCCESS +#endif + #ifdef __VXWORKS__ # include "pycore_bitutils.h" // _Py_popcount32() #endif