diff --git a/setup.py b/setup.py index ee4c54dc..a552b9d6 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages 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', diff --git a/thefuck/rules/no_command.py b/thefuck/rules/no_command.py index cfeab056..ce90926c 100644 --- a/thefuck/rules/no_command.py +++ b/thefuck/rules/no_command.py @@ -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)]