8000 Make docs of exitcode for subprocess.getstatusoutput more clear. (GH-… · python/cpython@7d16172 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d16172

Browse files
zhangyangyumiss-islington
authored andcommitted
Make docs of exitcode for subprocess.getstatusoutput more clear. (GH-9477)
Make it more accurate and not limited to UNIX.
1 parent 2ec872b commit 7d16172

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/subprocess.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,14 +1336,15 @@ handling consistency are valid for these functions.
13361336
Windows support was added.
13371337

13381338
The function now returns (exitcode, output) instead of (status, output)
1339-
as it did in Python 3.3.3 and earlier. See :func:`WEXITSTATUS`.
1339+
as it did in Python 3.3.3 and earlier. exitcode has the same value as
1340+
:attr:`~Popen.returncode`.
13401341

13411342

13421343
.. function:: getoutput(cmd)
13431344

13441345
Return output (stdout and stderr) of executing *cmd* in a shell.
13451346

1346-
Like :func:`getstatusoutput`, except the exit status is ignored and the return
1347+
Like :func:`getstatusoutput`, except the exit code is ignored and the return
13471348
value is a string containing the command's output. Example::
13481349

13491350
>>> subprocess.getoutput('ls /bin/ls')

0 commit comments

Comments
 (0)
0