summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-12-28 08:09:32 (GMT)
committerGeorg Brandl <georg@python.org>2009-12-28 08:09:32 (GMT)
commit02e7dfde639498064b137be7cb850c4229f0c8fb (patch)
tree6ffe383253474632d1fed9bd25cd8fdec43a24c2
parentfe8df4fa356179d139e15193a393e8aac78ac179 (diff)
downloadcpython-02e7dfde639498064b137be7cb850c4229f0c8fb.zip
cpython-02e7dfde639498064b137be7cb850c4229f0c8fb.tar.gz
cpython-02e7dfde639498064b137be7cb850c4229f0c8fb.tar.bz2
#7381: consistency update, and backport avoiding ``None >= 0`` check from py3k.
-rw-r--r--Lib/subprocess.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index b09a649..f63e719 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -136,7 +136,8 @@ check_output(*popenargs, **kwargs):
The arguments are the same as for the Popen constructor. Example:
- output = subprocess.check_output(["ls", "-l", "/dev/null"])
+ output = check_output(["ls", "-l", "/dev/null"])
+
Exceptions
----------
@@ -462,7 +463,8 @@ _active = []
def _cleanup():
for inst in _active[:]:
- if inst._internal_poll(_deadstate=sys.maxint) >= 0:
+ res = inst._internal_poll(_deadstate=sys.maxint)
+ if res is not None and res >= 0:
try:
_active.remove(inst)
except ValueError:
@@ -517,11 +519,11 @@ def check_output(*popenargs, **kwargs):
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
The stdout argument is not allowed as it is used internally.
- To capture standard error in the result, use stderr=subprocess.STDOUT.
+ To capture standard error in the result, use stderr=STDOUT.
>>> check_output(["/bin/sh", "-c",
... "ls -l non_existent_file ; exit 0"],
- ... stderr=subprocess.STDOUT)
+ ... stderr=STDOUT)
'ls: non_existent_file: No such file or directory\n'
"""
if 'stdout' in kwargs: