Mercurial > cpython-lru_cache-weakref
changeset 57959:fe0459dc9889 legacy-trunk
#7381: consistency update, and backport avoiding ``None >= 0`` check from py3k.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Mon, 28 Dec 2009 08:09:32 +0000 |
| parents | cbe1bbe544c9 |
| children | cf39c5e462f9 |
| files | Lib/subprocess.py |
| diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/Lib/subprocess.py Mon Dec 28 08:01:59 2009 +0000 +++ b/Lib/subprocess.py Mon Dec 28 08:09:32 2009 +0000 @@ -136,7 +136,8 @@ 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 @@ 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 @@ '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:
