ALTO: Handle PermissionErrors

master
Gerber, Mike 3 years ago
parent 10b8023dd6
commit 01326050d3

@ -79,7 +79,10 @@ def walk(m):
if f.is_file() and not f.name.startswith('.'): if f.is_file() and not f.name.startswith('.'):
yield f.path yield f.path
elif f.is_dir(): elif f.is_dir():
yield from walk(f.path) try:
yield from walk(f.path)
except PermissionError:
warnings.warn(f"Error walking {f.path}")
else: else:
yield m.path yield m.path

Loading…
Cancel
Save