Skip to content

Commit

Permalink
Update standard_paths so it only checks existing directories
Browse files Browse the repository at this point in the history
Fixes #216.
  • Loading branch information
fsouza committed Jan 31, 2023
1 parent c6fc836 commit 1a45397
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autoflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def standard_paths():
# Yield lib paths.
if path_name in paths:
path = paths[path_name]
yield from os.listdir(path)
if os.path.isdir(path):
yield from os.listdir(path)

# Yield lib-dynload paths.
dynload_path = os.path.join(path, "lib-dynload")
Expand Down

0 comments on commit 1a45397

Please sign in to comment.