[Python-3000-checkins] r57959 - python/branches/py3k/Lib/os.py

thomas.heller python-3000-checkins at python.org
Tue Sep 4 13:27:48 CEST 2007


Author: thomas.heller
Date: Tue Sep  4 13:27:47 2007
New Revision: 57959

Modified:
   python/branches/py3k/Lib/os.py
Log:
Make the _wrap_close type (which is returned by os.popen) iterable.
This should fix the Lib\test\test_uuid.py test on Windows.

Modified: python/branches/py3k/Lib/os.py
==============================================================================
--- python/branches/py3k/Lib/os.py	(original)
+++ python/branches/py3k/Lib/os.py	Tue Sep  4 13:27:47 2007
@@ -664,6 +664,8 @@
         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):


More information about the Python-3000-checkins mailing list