]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 18 Jan 2022 22:03:22 +0000 (14:03 -0800)
committerGitHub <noreply@github.com>
Tue, 18 Jan 2022 22:03:22 +0000 (14:03 -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.

(cherry picked from commit 3852269b91fcc8ee668cd876b3669eba6da5b1ac)

Co-authored-by: John Marshall <jmarshall@hey.com>
Doc/library/multiprocessing.rst
Misc/ACKS

index 96bc6c153284afb33a663ba48cb6c060589d0f3e..4966be303f4254e8a1117d2293829720a75092fa 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 ac893acbf3e4644b6bc6663025ceea8ac2467486..25c88656d42450c45d1d567428b6613d1a66f34f 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1095,6 +1095,7 @@ Vincent Marchetti
 David Marek
 Doug Marien
 Sven Marnach
+John Marshall
 Alex Martelli
 Dennis MÃ¥rtensson
 Anthony Martin