From 64dd018c1acd370253fdd37b6115ff75c4501ea3 Mon Sep 17 00:00:00 2001 From: RetekBacsi Date: Tue, 8 Oct 2019 23:43:19 +0200 Subject: [PATCH] =?UTF-8?q?Slow=20command=20timeout=20didn=E2=80=99t=20wor?= =?UTF-8?q?k=20(#961)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Slow command timeout didn’t work + Fixed debug message to include is_slow * Using only the first word of shlex.split when checking if command is slow. * Fixed index error when command is empty --- thefuck/output_readers/rerun.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thefuck/output_readers/rerun.py b/thefuck/output_readers/rerun.py index 74cbfbf6..af4f331a 100644 --- a/thefuck/output_readers/rerun.py +++ b/thefuck/output_readers/rerun.py @@ -53,8 +53,9 @@ def get_output(script, expanded): env = dict(os.environ) env.update(settings.env) - is_slow = shlex.split(expanded) in settings.slow_commands - with logs.debug_time(u'Call: {}; with env: {}; is slow: '.format( + split_expand = shlex.split(expanded) + is_slow = split_expand[0] in settings.slow_commands if split_expand else False + with logs.debug_time(u'Call: {}; with env: {}; is slow: {}'.format( script, env, is_slow)): result = Popen(expanded, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, env=env)