From b050c154a7b8fad76ccfd295010a3b24b69e1dd6 Mon Sep 17 00:00:00 2001 From: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:46:12 -0600 Subject: [PATCH] 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. (cherry picked from commit 68f583658247ceced323d79e1cf775c91c53c019) Co-authored-by: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> --- Doc/library/subprocess.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 63d52062bc23f3..4c7fb276311469 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).
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: