mirror of
https://github.com/python/cpython.git
synced 2025-08-24 10:45:53 +00:00
Add another try/except PermissionError to avoid depending on listdir order. Fix issues #24120 and #26012. (Merge 3.4->3.5)
This commit is contained in:
commit
c3a8272705
2 changed files with 16 additions and 13 deletions
|
@ -539,11 +539,14 @@ class _RecursiveWildcardSelector(_Selector):
|
|||
|
||||
def _iterate_directories(self, parent_path, is_dir, listdir):
|
||||
yield parent_path
|
||||
for name in listdir(parent_path):
|
||||
path = parent_path._make_child_relpath(name)
|
||||
if is_dir(path) and not path.is_symlink():
|
||||
for p in self._iterate_directories(path, is_dir, listdir):
|
||||
yield p
|
||||
try:
|
||||
for name in listdir(parent_path):
|
||||
path = parent_path._make_child_relpath(name)
|
||||
if is_dir(path) and not path.is_symlink():
|
||||
for p in self._iterate_directories(path, is_dir, listdir):
|
||||
yield p
|
||||
except PermissionError:
|
||||
return
|
||||
|
||||
def _select_from(self, parent_path, is_dir, exists, listdir):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue