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:
parent
31becc9456
commit
c4848d1816
1
setup.py
1
setup.py
@ -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',
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user