1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 20:11:17 +00:00

Slow command timeout didn’t work (#961)

* 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
This commit is contained in:
RetekBacsi 2019-10-08 23:43:19 +02:00 committed by Vladimir Iakovlev
parent 3bbd0e9463
commit 64dd018c1a

View File

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