mirror of
https://github.com/python/cpython.git
synced 2024-11-30 21:34:17 +08:00
gh-87452: Improve the Popen.returncode docs
Clarifies that it remains None until a method checking the child process status has been called and noticed it has terminated.
This commit is contained in:
parent
385d8d2b64
commit
68f5836582
@ -919,9 +919,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).
|
||||
|
Loading…
Reference in New Issue
Block a user