diff --git a/thefuck/rules/pyenv_no_such_command.py b/thefuck/rules/pyenv_no_such_command.py index 3acc857b..9466b5ef 100644 --- a/thefuck/rules/pyenv_no_such_command.py +++ b/thefuck/rules/pyenv_no_such_command.py @@ -1,7 +1,6 @@ import re from thefuck.utils import cache, for_app, replace_argument, replace_command, which -from thefuck.specific.devenv import env_available, COMMON_TYPOS -from subprocess import PIPE, Popen +from thefuck.specific.devenv import env_available, COMMON_TYPOS, get_commands enabled_by_default = env_available @@ -11,11 +10,6 @@ def match(command): return 'pyenv: no such command' in command.output -def get_commands(): - proc = Popen(['pyenv', 'commands'], stdout=PIPE) - return [line.decode('utf-8').strip() for line in proc.stdout.readlines()] - - if which('pyenv'): get_commands = cache(which('pyenv'))(get_commands) @@ -25,5 +19,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())) + matched.extend(replace_command(command, broken, get_commands(command))) return matched