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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reduce diff
  • Loading branch information
barneygale committed May 10, 2023
commit 556c70275a3ced025140b6851d65a07f8c2b0bb9
13 changes: 7 additions & 6 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,15 @@ def _iterate_directories(self, parent_path, scandir):
pass
else:
for entry in entries:
entry_is_dir = False
try:
if not entry.is_dir(follow_symlinks=False):
continue
entry_is_dir = entry.is_dir(follow_symlinks=False)
except OSError:
continue
path = parent_path._make_child_relpath(entry.name)
for p in self._iterate_directories(path, scandir):
yield p
pass
if entry_is_dir:
path = parent_path._make_child_relpath(entry.name)
for p in self._iterate_directories(path, scandir):
yield p

def _select_from(self, parent_path, scandir):
successor_select = self.successor._select_from
Expand Down