From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 21 Sep 2018 20:34:46 +0000 (-0700) Subject: Make docs of exitcode for subprocess.getstatusoutput more clear. (GH-9477) X-Git-Tag: v3.7.1rc1~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=914086aa2fa15d357e5bce36943c52e1cd843445;p=thirdparty%2FPython%2Fcpython.git Make docs of exitcode for subprocess.getstatusoutput more clear. (GH-9477) Make it more accurate and not limited to UNIX. (cherry picked from commit 7d161726e4ddd2b2cdd7ac58a7e9e9ea3f57a807) Co-authored-by: Xiang Zhang --- diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 19f6ff38bb2b..23beb52d3b9a 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1336,14 +1336,15 @@ handling consistency are valid for these functions. Windows support was added. The function now returns (exitcode, output) instead of (status, output) - as it did in Python 3.3.3 and earlier. See :func:`WEXITSTATUS`. + as it did in Python 3.3.3 and earlier. exitcode has the same value as + :attr:`~Popen.returncode`. .. function:: getoutput(cmd) Return output (stdout and stderr) of executing *cmd* in a shell. - Like :func:`getstatusoutput`, except the exit status is ignored and the return + Like :func:`getstatusoutput`, except the exit code is ignored and the return value is a string containing the command's output. Example:: >>> subprocess.getoutput('ls /bin/ls')