Skip to content

Commit

Permalink
fix(find): Handle OS' PermissionError
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Mar 21, 2022
1 parent af14baf commit ea94752
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bench/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ea94752

Please sign in to comment.