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
06c45e6e
Commit
06c45e6e
authored
Feb 11, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #25995: os.walk() no longer uses FDs proportional to the tree depth.
parent
94a619d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
Lib/os.py
Lib/os.py
+2
-11
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/os.py
View file @
06c45e6e
...
...
@@ -369,22 +369,13 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
# Note that scandir is global in this module due
# to earlier import-*.
scandir_it
=
scandir
(
top
)
entries
=
list
(
scandir
(
top
))
except
OSError
as
error
:
if
onerror
is
not
None
:
onerror
(
error
)
return
while
True
:
try
:
try
:
entry
=
next
(
scandir_it
)
except
StopIteration
:
break
except
OSError
as
error
:
if
onerror
is
not
None
:
onerror
(
error
)
return
for
entry
in
entries
:
try
:
is_dir
=
entry
.
is_dir
()
except
OSError
:
...
...
Misc/NEWS
View file @
06c45e6e
...
...
@@ -73,6 +73,8 @@ Core and Builtins
Library
-------
- Issue #25995: os.walk() no longer uses FDs proportional to the tree depth.
- Issue #26117: The os.scandir() iterator now closes file descriptor not only
when the iteration is finished, but when it was failed with error.
...
...
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