Visitar URL original
GH-90208: Suppress OSError exceptions from `pathlib.Path.glob()` by barneygale · Pull Request #104141 · python/cpython · GitHub
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
Merge branch 'main' into gh-90208-pathlib-glob-oserror-ignore
  • Loading branch information
barneygale committed May 7, 2023
commit 1b7cbb7b33e6c31cecb522d731ac4939bf0c5ba3
14 changes: 4 additions & 10 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,10 @@ def _iterate_directories(self, parent_path, scandir):
yield p

def _select_from(self, parent_path, scandir):
yielded = set()
try:
successor_select = self.successor._select_from
for starting_point in self._iterate_directories(parent_path, scandir):
for p in successor_select(starting_point, scandir):
if p not in yielded:
yield p
yielded.add(p)
finally:
yielded.clear()
successor_select = self.successor._select_from
for starting_point in self._iterate_directories(parent_path, scandir):
for p in successor_select(starting_point, scandir):
yield p


class _DoubleRecursiveWildcardSelector(_RecursiveWildcardSelector):
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.