def _select_from(self, parent_path, is_dir, exists, scandir):
try:
+ # We must close the scandir() object before proceeding to
+ # avoid exhausting file descriptors when globbing deep trees.
with scandir(parent_path) as scandir_it:
entries = list(scandir_it)
for entry in entries:
def _iterate_directories(self, parent_path, is_dir, scandir):
yield parent_path
try:
+ # We must close the scandir() object before proceeding to
+ # avoid exhausting file descriptors when globbing deep trees.
with scandir(parent_path) as scandir_it:
entries = list(scandir_it)
for entry in entries: