Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
75ed90a4
Commit
75ed90a4
authored
Mar 22, 2015
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#23700: fix/improve comment
parent
218144a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Lib/tempfile.py
Lib/tempfile.py
+4
-2
No files found.
Lib/tempfile.py
View file @
75ed90a4
...
...
@@ -427,8 +427,10 @@ class _TemporaryFileWrapper:
# iter() doesn't use __getattr__ to find the __iter__ method
def
__iter__
(
self
):
# Don't return iter(self.file), but yield from it to avoid closing
# file as long as it's being used as iterator, see issue #23000.
# XXX Also don't use "yield from"!
# file as long as it's being used as iterator (see issue #23700). We
# can't use 'yield from' here because iter(file) returns the file
# object itself, which has a close method, and thus the file would get
# closed when the generator is finalized, due to PEP380 semantics.
for
line
in
self
.
file
:
yield
line
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment