Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36d1f8e

Browse files
committed
As Guido says
1 parent c06950e commit 36d1f8e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/tempfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,9 @@ def __enter__(self):
394394
self.file.__enter__()
395395
return self
396396

397-
# XXX iter() doesn't use __getattr__ to find the __iter__ method
397+
# iter() doesn't use __getattr__ to find the __iter__ method
398398
def __iter__(self):
399-
return self.__getattr__('__iter__')()
399+
return iter(self.file)
400400

401401
# NT provides delete-on-close as a primitive, so we don't need
402402
# the wrapper to do anything special. We still use it so that

0 commit comments

Comments
 (0)