##// END OF EJS Templates
only use backports.shutil_get_terminal_size on Python 2...
Min RK -
Show More
@@ -9,22 +9,18 b' Authors:'
9 9 * Alexander Belchenko (e-mail: bialix AT ukr.net)
10 10 """
11 11
12 #-----------------------------------------------------------------------------
13 # Copyright (C) 2008-2011 The IPython Development Team
14 #
15 # Distributed under the terms of the BSD License. The full license is in
16 # the file COPYING, distributed as part of this software.
17 #-----------------------------------------------------------------------------
18
19 #-----------------------------------------------------------------------------
20 # Imports
21 #-----------------------------------------------------------------------------
12 # Copyright (c) IPython Development Team.
13 # Distributed under the terms of the Modified BSD License.
22 14
23 15 import os
24 16 import struct
25 17 import sys
26 18 import warnings
27 import backports.shutil_get_terminal_size
19 try:
20 from shutil import get_terminal_size as _get_terminal_size
21 except ImportError:
22 # use backport on Python 2
23 from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size
28 24
29 25 from . import py3compat
30 26
@@ -122,4 +118,4 b' def freeze_term_title():'
122 118
123 119
124 120 def get_terminal_size(defaultx=80, defaulty=25):
125 return backports.shutil_get_terminal_size.get_terminal_size((defaultx, defaulty))
121 return _get_terminal_size((defaultx, defaulty))
@@ -197,7 +197,6 b' install_requires = ['
197 197 'traitlets',
198 198 'prompt_toolkit>=0.60',
199 199 'pygments',
200 'backports.shutil_get_terminal_size',
201 200 ]
202 201
203 202 # Platform-specific dependencies:
@@ -205,6 +204,7 b' install_requires = ['
205 204 # but requires pip >= 6. pip < 6 ignores these.
206 205
207 206 extras_require.update({
207 ':python_version == "2.7"': ['backports.shutil_get_terminal_size'],
208 208 ':python_version == "2.7" or python_version == "3.3"': ['pathlib2'],
209 209 ':sys_platform != "win32"': ['pexpect'],
210 210 ':sys_platform == "darwin"': ['appnope'],
General Comments 0
You need to be logged in to leave comments. Login now