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

Skip to content
/ cpython Public

Commit 29da839

Browse files
Make docs of exitcode for subprocess.getstatusoutput more clear. (GH-9477)
Make it more accurate and not limited to UNIX. (cherry picked from commit 7d16172) Co-authored-by: Xiang Zhang <angwerzx@126.com>
1 parent f37496e commit 29da839

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
@@ -1199,14 +1199,15 @@ handling consistency are valid for these functions.
11991199
Windows support was added.
12001200

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

12041205

12051206
.. function:: getoutput(cmd)
12061207

12071208
Return output (stdout and stderr) of executing *cmd* in a shell.
12081209

1209-
Like :func:`getstatusoutput`, except the exit status is ignored and the return
1210+
Like :func:`getstatusoutput`, except the exit code is ignored and the return
12101211
value is a string containing the command's output. Example::
12111212

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

0 commit comments

Comments
 (0)
0