diff --git a/tests/rules/test_brew_unknown_command.py b/tests/rules/test_brew_unknown_command.py index 17adb47..42e6c7f 100644 --- a/tests/rules/test_brew_unknown_command.py +++ b/tests/rules/test_brew_unknown_command.py @@ -24,5 +24,6 @@ def test_get_new_command(brew_unknown_cmd, brew_unknown_cmd2): assert get_new_command(Command('brew inst', stderr=brew_unknown_cmd), None) == ['brew list', 'brew install', 'brew uninstall'] - assert get_new_command(Command('brew instaa', stderr=brew_unknown_cmd2), - None) == ['brew install', 'brew uninstall', 'brew list'] + cmds = get_new_command(Command('brew instaa', stderr=brew_unknown_cmd2), None) + assert 'brew install' in cmds + assert 'brew uninstall' in cmds diff --git a/thefuck/utils.py b/thefuck/utils.py index 0c3266b..e874efc 100644 --- a/thefuck/utils.py +++ b/thefuck/utils.py @@ -95,7 +95,7 @@ def get_all_executables(): tf_alias = thefuck_alias() return [exe.name for path in os.environ.get('PATH', '').split(':') - for exe in _safe(Path(path).iterdir, []) + for exe in _safe(lambda: list(Path(path).iterdir()), []) if not _safe(exe.is_dir, True)] + [ alias for alias in get_aliases() if alias != tf_alias]