1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-20 20:09:07 +00:00

Fix python 3 support

This commit is contained in:
nvbn 2015-04-21 06:33:51 +02:00
parent e7d5d93056
commit ab8ac23749

View File

@ -76,7 +76,10 @@ def wait_output(settings, popen):
def get_command(settings, args):
"""Creates command from `args` and executes it."""
script = ' '.join(arg.decode('utf-8') for arg in args[1:])
if sys.version_info[0] < 3:
script = ' '.join(arg.decode('utf-8') for arg in args[1:])
else:
script = ' '.join(args[1:])
result = Popen(script, shell=True, stdout=PIPE, stderr=PIPE,
env=dict(os.environ, LANG='C'))
if wait_output(settings, result):