diff --git a/thefuck/rules/pyenv_no_such_command.py b/thefuck/rules/pyenv_no_such_command.py index 6fdb8708..3acc857b 100644 --- a/thefuck/rules/pyenv_no_such_command.py +++ b/thefuck/rules/pyenv_no_such_command.py @@ -11,11 +11,8 @@ def match(command): return 'pyenv: no such command' in command.output -def get_commands(command): - if 'env' in command.script_parts[0]: - proc = Popen(['pyenv', 'commands'], stdout=PIPE) - else: - proc = Popen(['pyenv', 'commands'], stdout=PIPE) +def get_commands(): + proc = Popen(['pyenv', 'commands'], stdout=PIPE) return [line.decode('utf-8').strip() for line in proc.stdout.readlines()] @@ -28,5 +25,5 @@ def get_new_command(command): broken = re.findall(r"pyenv: no such command `([^']*)'", command.output)[0] matched = [replace_argument(command.script, broken, common_typo) for common_typo in COMMON_TYPOS.get(broken, [])] - matched.extend(replace_command(command, broken, get_commands(command))) + matched.extend(replace_command(command, broken, get_commands())) return matched