10000 [3.9] bpo-45554: Document multiprocessing.Process.exitcode values (GH… · python/cpython@0be4760 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0be4760

Browse files
[3.9] bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142) (GH-30675)
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 3852269) Co-authored-by: John Marshall <jmarshall@hey.com>
1 parent 0ae2257 commit 0be4760

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
@@ -1095,6 +1095,7 @@ Vincent Marchetti
10951095
David Marek
10961096
Doug Marien
10971097
Sven Marnach
1098+
John Marshall
10981099
Alex Martelli
10991100
Dennis Mårtensson
11001101
Anthony Martin

0 commit comments

Comments
 (0)
0