summaryrefslogtreecommitdiff
path: root/sphinx/util/console.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-12 02:50:43 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-12 02:50:43 +0900
commit279e547860ea68e3c357f55e608afec682a1f961 (patch)
treedc08e85ab0210538e30b5b801bf9d80ab49bfb3f /sphinx/util/console.py
parent859b5fcea71f8d4f46e0ef3726e68df54bfbc3b7 (diff)
parent64fb1e56242d93ee0e8c317ab9e7643242b99658 (diff)
downloadsphinx-git-279e547860ea68e3c357f55e608afec682a1f961.tar.gz
Merge branch '3.x'
Diffstat (limited to 'sphinx/util/console.py')
-rw-r--r--sphinx/util/console.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/util/console.py b/sphinx/util/console.py
index d429be602..579a95134 100644
--- a/sphinx/util/console.py
+++ b/sphinx/util/console.py
@@ -32,9 +32,9 @@ def terminal_safe(s: str) -> str:
def get_terminal_width() -> int:
"""Borrowed from the py lib."""
try:
- import termios
import fcntl
import struct
+ import termios
call = fcntl.ioctl(0, termios.TIOCGWINSZ, struct.pack('hhhh', 0, 0, 0, 0))
height, width = struct.unpack('hhhh', call)[:2]
terminal_width = width