@@ -110,7 +110,7 @@ class Popen(args, bufsize=0, executable=None,
110110
111111 The arguments are the same as for the Popen constructor. Example:
112112
113- retcode = call(["ls", "-l"])
113+ >>> retcode = call(["ls", "-l"])
114114
115115check_call(*popenargs, **kwargs):
116116 Run command with arguments. Wait for command to complete. If the
@@ -120,7 +120,8 @@ class Popen(args, bufsize=0, executable=None,
120120
121121 The arguments are the same as for the Popen constructor. Example:
122122
123- check_call(["ls", "-l"])
123+ >>> check_call(["ls", "-l"])
124+ 0
124125
125126getstatusoutput(cmd):
126127 Return (status, output) of executing cmd in a shell.
@@ -131,7 +132,6 @@ class Popen(args, bufsize=0, executable=None,
131132 is stripped from the output. The exit status for the command can be
132133 interpreted according to the rules for the C function wait(). Example:
133134
134- >>> import subprocess
135135 >>> subprocess.getstatusoutput('ls /bin/ls')
136136 (0, '/bin/ls')
137137 >>> subprocess.getstatusoutput('cat /bin/junk')
@@ -145,20 +145,19 @@ class Popen(args, bufsize=0, executable=None,
145145 Like getstatusoutput(), except the exit status is ignored and the return
146146 value is a string containing the command's output. Example:
147147
148- >>> import subprocess
149148 >>> subprocess.getoutput('ls /bin/ls')
150149 '/bin/ls'
151150
152151check_output(*popenargs, **kwargs):
153- Run command with arguments and return its output as a byte string.
152+ Run command with arguments and return its output as a byte string.
154153
155- If the exit code was non-zero it raises a CalledProcessError. The
156- CalledProcessError object will have the return code in the returncode
157- attribute and output in the output attribute.
154+ If the exit code was non-zero it raises a CalledProcessError. The
155+ CalledProcessError object will have the return code in the returncode
156+ attribute and output in the output attribute.
158157
159- The arguments are the same as for the Popen constructor. Example:
158+ The arguments are the same as for the Popen constructor. Example:
160159
161- output = subprocess.check_output(["ls", "-l", "/dev/null"])
160+ >>> output = subprocess.check_output(["ls", "-l", "/dev/null"])
162161
163162
164163Exceptions
@@ -437,7 +436,7 @@ def check_call(*popenargs, **kwargs):
437436
438437
439438def check_output (* popenargs , ** kwargs ):
440- """Run command with arguments and return its output as a byte string.
439+ r """Run command with arguments and return its output as a byte string.
441440
442441 If the exit code was non-zero it raises a CalledProcessError. The
443442 CalledProcessError object will have the return code in the returncode
@@ -446,15 +445,15 @@ def check_output(*popenargs, **kwargs):
446445 The arguments are the same as for the Popen constructor. Example:
447446
448447 >>> check_output(["ls", "-l", "/dev/null"])
449- 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n '
448+ b 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
450449
451450 The stdout argument is not allowed as it is used internally.
452- To capture standard error in the result, use stderr=subprocess. STDOUT.
451+ To capture standard error in the result, use stderr=STDOUT.
453452
454453 >>> check_output(["/bin/sh", "-c",
455- "ls -l non_existent_file ; exit 0"],
456- stderr=subprocess. STDOUT)
457- 'ls: non_existent_file: No such file or directory\n '
454+ ... "ls -l non_existent_file ; exit 0"],
455+ ... stderr=STDOUT)
456+ b 'ls: non_existent_file: No such file or directory\n'
458457 """
459458 if 'stdout' in kwargs :
460459 raise ValueError ('stdout argument not allowed, it will be overridden.' )
0 commit comments