diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-01-18 22:03:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 22:03:22 (GMT) |
commit | 0be4760d85399a308421d9229b5d7f1b4ec718a2 (patch) | |
tree | 32611884fa59505d11ecb34792a6fdc726fd5795 /Doc/library/multiprocessing.rst | |
parent | 0ae22577606f1b52e3b6c2de6c5b307518044605 (diff) | |
download | cpython-0be4760d85399a308421d9229b5d7f1b4ec718a2.zip cpython-0be4760d85399a308421d9229b5d7f1b4ec718a2.tar.gz cpython-0be4760d85399a308421d9229b5d7f1b4ec718a2.tar.bz2 |
[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 3852269b91fcc8ee668cd876b3669eba6da5b1ac)
Co-authored-by: John Marshall <jmarshall@hey.com>
Diffstat (limited to 'Doc/library/multiprocessing.rst')
-rw-r--r-- | Doc/library/multiprocessing.rst | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 96bc6c1..4966be3 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 |