8000 bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142) · python/cpython@4449a16 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4449a16

Browse files
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 (cherry picked from commit 3852269) Co-authored-by: John Marshall <jmarshall@hey.com>
1 parent 9238a52 commit 4449a16

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Doc/library/multiprocessing.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,15 @@ The :mod:`multiprocessing` package mostly replicates the API of the
569569
.. attribute:: exitcode
570570

571571
The child's exit code. This will be ``None`` if the process has not yet
572-
terminated. A negative value *-N* indicates that the child was terminated
573-
by signal *N*.
572+
terminated.
573+
574+
If the child's :meth:`run` method returned normally, the exit code
575+
will be 0. If it terminated via :func:`sys.exit` with an integer
576+
argument *N*, the exit code will be *N*.
577+
578+
If the child terminated due to an exception not caught within
579+
:meth:`run`, the exit code will be 1. If it was terminated by
580+
signal *N*, the exit code will be the negative value *-N*.
574581

575582
.. attribute:: authkey
576583

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ Vincent Marchetti
11151115
David Marek
11161116
Doug Marien
11171117
Sven Marnach
1118+
John Marshall
11181119
Alex Martelli
11191120
Dennis Mårtensson
11201121
Anthony Martin

0 commit comments

Comments
 (0)
0