2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-29 23:39:02 +00:00

fix(find): Handle OS' PermissionError

This commit is contained in:
Gavin D'souza 2022-03-21 13:38:04 +05:30
parent af14bafe21
commit ea947523b3

View File

@ -314,7 +314,13 @@ def find_benches(directory: str = None) -> List:
return
benches = []
for sub in os.listdir(directory):
try:
sub_directories = os.listdir(directory)
except PermissionError:
return benches
for sub in sub_directories:
sub = os.path.join(directory, sub)
if os.path.isdir(sub) and not os.path.islink(sub):
if is_bench_directory(sub):