summaryrefslogtreecommitdiff
path: root/sphinx/util/console.py
diff options
context:
space:
mode:
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