1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 06:38:32 +00:00

Test error source

This commit is contained in:
gkodosis 2020-07-03 15:44:19 +03:00
parent 8be4ae4cda
commit 8d256125bf

View File

@ -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