[Python-checkins] [3.11] gh-87452: Improve the Popen.returncode docs (#103771)

ambv webhook-mailer at python.org
Tue Apr 25 12:15:56 EDT 2023


https://github.com/python/cpython/commit/05a25867ae3ab20a0d95aeed227a3882f359e528
commit: 05a25867ae3ab20a0d95aeed227a3882f359e528
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2023-04-25T18:15:48+02:00
summary:

[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 68f583658247ceced323d79e1cf775c91c53c019)

Co-authored-by: Joshua Herman <30265+zitterbewegung at users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz at langa.pl>

files:
M Doc/library/subprocess.rst

diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 63d52062bc23..4c7fb2763114 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -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).



More information about the Python-checkins mailing list