Skip to content

Commit 3852269

Browse files
authored
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
1 parent 16bf9bd commit 3852269

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
@@ -1118,6 +1118,7 @@ Vincent Marchetti
11181118
David Marek
11191119
Doug Marien
11201120
Sven Marnach
1121+
John Marshall
11211122
Alex Martelli
11221123
Dennis Mårtensson
11231124
Anthony Martin

0 commit comments

Comments
 (0)