Browse Source

omit read protected directory when checking for changes in the beginning

master
Nils 5 years ago
parent
commit
60e3d0b452
  1. 8
      engine/watcher.py

8
engine/watcher.py

@ -31,8 +31,12 @@ from engine.start import PATHS
def fast_scandir(dir):
"""
Get all subdirectories recursively.
https://stackoverflow.com/questions/973473/getting-a-list-of-all-subdirectories-in-the-current-directory"""
subfolders= [f.path for f in os.scandir(dir) if f.is_dir()]
https://stackoverflow.com/questions/973473/getting-a-list-of-all-subdirectories-in-the-current-directory"""
try:
subfolders= [f.path for f in os.scandir(dir) if f.is_dir()]
except PermissionError:
subfolders = []
for dir in list(subfolders):
subfolders.extend(fast_scandir(dir))
return subfolders

Loading…
Cancel
Save