mirror of
https://github.com/python/cpython.git
synced 2025-10-02 05:12:23 +00:00
[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 68f5836582
)
Co-authored-by: Joshua Herman <30265+zitterbewegung@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
03f8d8f0d8
commit
05a25867ae
1 changed files with 6 additions and 3 deletions
|
@ -921,9 +921,12 @@ Reassigning them to new values is unsupported:
|
||||||
|
|
||||||
.. attribute:: Popen.returncode
|
.. attribute:: Popen.returncode
|
||||||
|
|
||||||
The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly
|
The child return code. Initially ``None``, :attr:`returncode` is set by
|
||||||
by :meth:`communicate`). A ``None`` value indicates that the process
|
a call to the :meth:`poll`, :meth:`wait`, or :meth:`communicate` methods
|
||||||
hasn't terminated yet.
|
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
|
A negative value ``-N`` indicates that the child was terminated by signal
|
||||||
``N`` (POSIX only).
|
``N`` (POSIX only).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue