From 75c774ac225e7c32feaff63180bcd25f34638a32 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Sun, 6 Jun 2021 20:37:00 +1000 Subject: [PATCH 1/4] [Modules/posixmodule.c] Added `os.EX_OK` for Windows; [Doc/library/os.rst] Reflect Windows `os.EX_OK` support in doc --- Doc/library/os.rst | 2 +- Modules/posixmodule.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 4b249ed92c3588e..f57b288223d6d03 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3658,7 +3658,7 @@ written in Python, such as a mail server's external command delivery program. Exit code that means no error occurred. - .. availability:: Unix. + .. availability:: Unix, Windows. .. data:: EX_USAGE diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 25ddc82cb893ab3..e5e91d9eeb74506 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -21,6 +21,7 @@ FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */ # include # include +#define EX_OK EXIT_SUCCESS #endif #ifdef __VXWORKS__ From e3c5139da88935455d91772128ca7010fae7b666 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Tue, 8 Jun 2021 16:58:40 +1000 Subject: [PATCH 2/4] Update Modules/posixmodule.c Co-authored-by: Steve Dower --- Modules/posixmodule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index e5e91d9eeb74506..73e7e60fe63ff45 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -21,6 +21,9 @@ FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */ # include # include +#endif + +#if !defined(EX_OK) && defined(EXIT_SUCCESS) #define EX_OK EXIT_SUCCESS #endif From 10a57ce8fe75621e498d1f01083abfc193ddfbf4 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Tue, 8 Jun 2021 16:58:49 +1000 Subject: [PATCH 3/4] Update Doc/library/os.rst Co-authored-by: Steve Dower --- Doc/library/os.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index f57b288223d6d03..07b124fca6b7259 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3656,7 +3656,8 @@ 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, Windows. From 9678d3fb0707c88a2ac0d9b978fbfe343076b6f4 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Sat, 12 Jun 2021 17:57:23 +1000 Subject: [PATCH 4/4] Update Doc/library/os.rst Co-authored-by: Steve Dower --- Doc/library/os.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 07b124fca6b7259..d3ca8c0476d0c56 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3657,7 +3657,7 @@ written in Python, such as a mail server's external command delivery program. .. data:: EX_OK 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. + ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero. .. availability:: Unix, Windows.