Skip to content

Commit

Permalink
nvbn#71 Handle iterdir iterator fails
Browse files Browse the repository at this point in the history
  • Loading branch information
nvbn committed Apr 21, 2015
1 parent 798928b commit bd5f504
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


setup(name='thefuck',
version="1.21",
version="1.22",
description="Magnificent app which corrects your previous console command",
author='Vladimir Iakovlev',
author_email='nvbn.rm@gmail.com',
Expand Down
4 changes: 2 additions & 2 deletions thefuck/rules/no_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def _safe(fn, fallback):

def _get_all_bins():
return [exe.name
for path in os.environ['PATH'].split(':')
for exe in _safe(lambda: Path(path).iterdir(), [])
for path in os.environ.get('PATH', '').split(':')
for exe in _safe(lambda: list(Path(path).iterdir()), [])
if not _safe(exe.is_dir, True)]


Expand Down

0 comments on commit bd5f504

Please sign in to comment.