[Python-checkins] bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142)

miss-islington webhook-mailer at python.org
Tue Jan 18 16:31:40 EST 2022


https://github.com/python/cpython/commit/3852269b91fcc8ee668cd876b3669eba6da5b1ac
commit: 3852269b91fcc8ee668cd876b3669eba6da5b1ac
branch: main
author: John Marshall <jmarshall at hey.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022年01月18日T13:31:27-08:00
summary:
bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142)
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
files:
M Doc/library/multiprocessing.rst
M Misc/ACKS
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 7a1a285255ff7..9bb7dd3d703ab 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 7f2e94dfa615f..04d6a651489bb 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /