Skip to content

Commit 820c64a

Browse files
committed
bpo-45554: Document multiprocessing.Process.exitcode values
1 parent 7f4b69b commit 820c64a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-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
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Expand the :attr:`multiprocessing.Process.exitcode` documentation.

0 commit comments

Comments
 (0)