summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2009-07-11 09:37:09 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2009-07-11 09:37:09 (GMT)
commit041b3baf53e3d1bf4b9941fd91ff807daef5965d (patch)
treee1ea38a7af741763ce9138df82530c0e64ec1d1e /Lib/os.py
parent1caf206ac941c2051cfea189d7431e7cf27fa21b (diff)
downloadcpython-041b3baf53e3d1bf4b9941fd91ff807daef5965d.zip
cpython-041b3baf53e3d1bf4b9941fd91ff807daef5965d.tar.gz
cpython-041b3baf53e3d1bf4b9941fd91ff807daef5965d.tar.bz2
Merged revisions 73934 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r73934 | amaury.forgeotdarc | 2009-07-11 11:35:13 +0200 (sam., 11 juil. 2009) | 3 lines #6358: Merge r73933: Add basic tests for the return value of os.popen().close(). And fix the implementation to make these tests pass with py3k ........
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 5dce0c1..a59c5df 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -643,7 +643,13 @@ class _wrap_close:
self._proc = proc
def close(self):
self._stream.close()
- return self._proc.wait() << 8 # Shift left to match old behavior
+ returncode = self._proc.wait()
+ if returncode == 0:
+ return None
+ if name == 'nt':
+ return returncode
+ else:
+ return returncode << 8 # Shift left to match old behavior
def __getattr__(self, name):
return getattr(self._stream, name)
def __iter__(self):