mirror of
https://github.com/frappe/bench.git
synced 2024-11-17 18:45:19 +00:00
fix(find): Handle OS' PermissionError
This commit is contained in:
parent
af14bafe21
commit
ea947523b3
@ -314,7 +314,13 @@ def find_benches(directory: str = None) -> List:
|
|||||||
return
|
return
|
||||||
|
|
||||||
benches = []
|
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)
|
sub = os.path.join(directory, sub)
|
||||||
if os.path.isdir(sub) and not os.path.islink(sub):
|
if os.path.isdir(sub) and not os.path.islink(sub):
|
||||||
if is_bench_directory(sub):
|
if is_bench_directory(sub):
|
||||||
|
Loading…
Reference in New Issue
Block a user