]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make the _wrap_close type (which is returned by os.popen) iterable.
authorThomas Heller <theller@ctypes.org>
Tue, 4 Sep 2007 11:27:47 +0000 (11:27 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 4 Sep 2007 11:27:47 +0000 (11:27 +0000)
This should fix the Lib\test\test_uuid.py test on Windows.

Lib/os.py

index 727d0cb27c2afa9bbed3e0f419a485bd88ff6a82..e8676d9fee477a450f986e90686de92892ca00f1 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -664,6 +664,8 @@ class _wrap_close:
         return self._proc.wait() << 8  # Shift left to match old behavior
     def __getattr__(self, name):
         return getattr(self._stream, name)
+    def __iter__(self):
+        return iter(self._stream)
 
 # Supply os.fdopen() (used by subprocess!)
 def fdopen(fd, mode="r", buffering=-1):