Skip to content

Commit 05a2586

Browse files
miss-islingtonzitterbewegungambv
authored
[3.11] gh-87452: Improve the Popen.returncode docs (#103771)
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 <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
1 parent 03f8d8f commit 05a2586

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Doc/library/subprocess.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -921,9 +921,12 @@ Reassigning them to new values is unsupported:
921921

922922
.. attribute:: Popen.returncode
923923

924-
The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly
925-
by :meth:`communicate`). A ``None`` value indicates that the process
926-
hasn't terminated yet.
924+
The child return code. Initially ``None``, :attr:`returncode` is set by
925+
a call to the :meth:`poll`, :meth:`wait`, or :meth:`communicate` methods
926+
if they detect that the process has terminated.
927+
928+
A ``None`` value indicates that the process hadn't yet terminated at the
929+
time of the last method call.
927930

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

0 commit comments

Comments
 (0)