]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142)
authorJohn Marshall <jmarshall@hey.com>
Tue, 18 Jan 2022 21:31:27 +0000 (21:31 +0000)
committerGitHub <noreply@github.com>
Tue, 18 Jan 2022 21:31:27 +0000 (13:31 -0800)
This addresses [bpo-45554]() by expanding the `exitcode` documentation to also describe what `exitcode` will be in cases of normal termination, `sys.exit()` called, and on uncaught exceptions.

Automerge-Triggered-By: GH:pitrou
Doc/library/multiprocessing.rst
Misc/ACKS

index 7a1a285255ff7b5376ad62e30a3890ea2785722d..9bb7dd3d703ab1de755df79c725b596873341f16 100644 (file)
@@ -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
 
index 7f2e94dfa615f1054caf6d39720a7f3e281653a3..04d6a651489bbbbd951f15111067f7aaceac5a20 100644 (file)
--- 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