1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-31 02:01:13 +00:00

#682: Fix tests in python 2

This commit is contained in:
Vladimir Iakovlev 2017-08-26 06:20:52 +02:00
parent 31becc9456
commit c4848d1816
2 changed files with 6 additions and 2 deletions

View File

@ -35,6 +35,7 @@ VERSION = '3.21'
install_requires = ['psutil', 'colorama', 'six', 'decorator', 'pyte']
extras_require = {':python_version<"3.4"': ['pathlib2'],
':python_version<"3.3"': ['backports.shutil_get_terminal_size'],
":sys_platform=='win32'": ['win_unicode_console']}
setup(name='thefuck',

View File

@ -1,6 +1,9 @@
import os
import shlex
from shutil import get_terminal_size
try:
from shutil import get_terminal_size
except ImportError:
from backports.shutil_get_terminal_size import get_terminal_size
from warnings import warn
import pyte
from ..exceptions import ScriptNotInLog
@ -60,7 +63,7 @@ def get_output(script):
lines = _get_output_lines(script, log_file)
output = '\n'.join(lines).strip()
return output, output
except FileNotFoundError:
except OSError:
warn("Can't read output log")
return None, None
except ScriptNotInLog: