diff options
author | Georg Brandl <georg@python.org> | 2009-12-20 14:33:20 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-12-20 14:33:20 +0000 |
commit | 6ab5d083f20aa63d689ed095e7660aef4241cd22 (patch) | |
tree | 8bcf0e1ef0866c8e723f66a089805702d1580b46 /Lib/subprocess.py | |
parent | 819a8fa0f694bea3099f704d01ba51c5350c71b1 (diff) | |
download | cpython-git-6ab5d083f20aa63d689ed095e7660aef4241cd22.tar.gz |
#7381: subprocess documentation and library docstring consistency fixes.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index f143460990..b09a6492b2 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -128,15 +128,15 @@ check_call(*popenargs, **kwargs): check_call(["ls", "-l"]) check_output(*popenargs, **kwargs): - Run command with arguments and return its output as a byte string. + Run command with arguments and return its output as a byte string. - If the exit code was non-zero it raises a CalledProcessError. The - CalledProcessError object will have the return code in the returncode - attribute and output in the output attribute. + If the exit code was non-zero it raises a CalledProcessError. The + CalledProcessError object will have the return code in the returncode + attribute and output in the output attribute. - The arguments are the same as for the Popen constructor. Example: + The arguments are the same as for the Popen constructor. Example: - output = subprocess.check_output(["ls", "-l", "/dev/null"]) + output = subprocess.check_output(["ls", "-l", "/dev/null"]) Exceptions ---------- @@ -505,7 +505,7 @@ def check_call(*popenargs, **kwargs): def check_output(*popenargs, **kwargs): - """Run command with arguments and return its output as a byte string. + r"""Run command with arguments and return its output as a byte string. If the exit code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode @@ -520,8 +520,8 @@ def check_output(*popenargs, **kwargs): To capture standard error in the result, use stderr=subprocess.STDOUT. >>> check_output(["/bin/sh", "-c", - "ls -l non_existent_file ; exit 0"], - stderr=subprocess.STDOUT) + ... "ls -l non_existent_file ; exit 0"], + ... stderr=subprocess.STDOUT) 'ls: non_existent_file: No such file or directory\n' """ if 'stdout' in kwargs: |