Skip to content

Commit

Permalink
pythongh-87452: Improve the Popen.returncode docs
Browse files Browse the repository at this point in the history
Clarifies that it remains None until a method checking the child process status has been called and noticed it has terminated.
(cherry picked from commit 68f5836)

Co-authored-by: Joshua Herman <30265+zitterbewegung@users.noreply.github.com>
  • Loading branch information
zitterbewegung authored and miss-islington committed Apr 24, 2023
1 parent 25406e5 commit b050c15
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Doc/library/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -921,9 +921,12 @@ Reassigning them to new values is unsupported:

.. attribute:: Popen.returncode

The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly
by :meth:`communicate`). A ``None`` value indicates that the process
hasn't terminated yet.
The child return code. Initially ``None``, :attr:`returncode` is set by
a call to the :meth:`poll`, :meth:`wait`, or :meth:`communicate` methods
if they detect that the process has terminated.

A ``None`` value indicates that the process hadn't yet terminated at the
time of the last method call.

A negative value ``-N`` indicates that the child was terminated by signal
``N`` (POSIX only).
Expand Down

0 comments on commit b050c15

Please sign in to comment.