diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-07-11 09:35:13 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-07-11 09:35:13 (GMT) |
commit | 97e5f281a7dd4ce7ae0d5a967d8da0623e1e1d56 (patch) | |
tree | ba58b176a13ca8fcc7c020a61933e674d113fa64 /Lib/os.py | |
parent | 15ccb3d3f741ceffd7b2dca67870bbee5cfe3a49 (diff) | |
download | cpython-97e5f281a7dd4ce7ae0d5a967d8da0623e1e1d56.zip cpython-97e5f281a7dd4ce7ae0d5a967d8da0623e1e1d56.tar.gz cpython-97e5f281a7dd4ce7ae0d5a967d8da0623e1e1d56.tar.bz2 |
#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.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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): |