]> granicus.if.org Git - python/commitdiff
As Guido says
authorChristian Heimes <christian@cheimes.de>
Thu, 28 Feb 2008 22:21:11 +0000 (22:21 +0000)
committerChristian Heimes <christian@cheimes.de>
Thu, 28 Feb 2008 22:21:11 +0000 (22:21 +0000)
Lib/tempfile.py

index 11a4c60e2dcd26f6175c315fc0cb3543311fbe20..df1317d587dc074eccc68bd1232a15b38119cd48 100644 (file)
@@ -394,9 +394,9 @@ class _TemporaryFileWrapper:
         self.file.__enter__()
         return self
 
-    # XXX iter() doesn't use __getattr__ to find the __iter__ method
+    # iter() doesn't use __getattr__ to find the __iter__ method
     def __iter__(self):
-        return self.__getattr__('__iter__')()
+        return iter(self.file)
 
     # NT provides delete-on-close as a primitive, so we don't need
     # the wrapper to do anything special.  We still use it so that