From 820c64a15d8d0deddbb50da235d819b71fcaec51 Mon Sep 17 00:00:00 2001 From: John Marshall Date: Fri, 26 Nov 2021 14:30:15 +0000 Subject: [PATCH 1/2] bpo-45554: Document multiprocessing.Process.exitcode values --- Doc/library/multiprocessing.rst | 11 +++++++++-- Misc/ACKS | 1 + .../2021-12-16-11-44-21.bpo-45554.RhPt2B.rst | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 7a1a285255ff7b..9bb7dd3d703ab1 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -569,8 +569,15 @@ The :mod:`multiprocessing` package mostly replicates the API of the .. attribute:: exitcode The child's exit code. This will be ``None`` if the process has not yet - terminated. A negative value *-N* indicates that the child was terminated - by signal *N*. + terminated. + + If the child's :meth:`run` method returned normally, the exit code + will be 0. If it terminated via :func:`sys.exit` with an integer + argument *N*, the exit code will be *N*. + + If the child terminated due to an exception not caught within + :meth:`run`, the exit code will be 1. If it was terminated by + signal *N*, the exit code will be the negative value *-N*. .. attribute:: authkey diff --git a/Misc/ACKS b/Misc/ACKS index 7f2e94dfa615f1..04d6a651489bbb 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1118,6 +1118,7 @@ Vincent Marchetti David Marek Doug Marien Sven Marnach +John Marshall Alex Martelli Dennis MÃ¥rtensson Anthony Martin diff --git a/Misc/NEWS.d/next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst b/Misc/NEWS.d/next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst new file mode 100644 index 00000000000000..bbb844751671f6 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst @@ -0,0 +1 @@ +Expand the :attr:`multiprocessing.Process.exitcode` documentation. From 7896852a6d2c9bce0aedd8d3f6b4cf47137f6569 Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Tue, 18 Jan 2022 15:14:04 -0600 Subject: [PATCH 2/2] Delete 2021-12-16-11-44-21.bpo-45554.RhPt2B.rst --- .../next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst diff --git a/Misc/NEWS.d/next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst b/Misc/NEWS.d/next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst deleted file mode 100644 index bbb844751671f6..00000000000000 --- a/Misc/NEWS.d/next/Documentation/2021-12-16-11-44-21.bpo-45554.RhPt2B.rst +++ /dev/null @@ -1 +0,0 @@ -Expand the :attr:`multiprocessing.Process.exitcode` documentation.