mirror of
https://github.com/svpcom/wfb-ng.git
synced 2025-02-21 16:03:49 -04:00
Fix issue with termios and python < 3.11
This commit is contained in:
parent
0a5282c25a
commit
5b51172ec7
@ -24,6 +24,8 @@ import msgpack
|
||||
import tempfile
|
||||
import signal
|
||||
import termios
|
||||
import struct
|
||||
import fcntl
|
||||
|
||||
from twisted.python import log
|
||||
from twisted.internet import reactor, defer
|
||||
@ -165,7 +167,8 @@ class AntennaStatClientFactory(ReconnectingClientFactory):
|
||||
|
||||
def init_windows(self):
|
||||
self.windows.clear()
|
||||
height, width = termios.tcgetwinsize(1)
|
||||
# python < 3.11 doesn't have termios.tcgetwinsize
|
||||
height, width = struct.unpack('hh', fcntl.ioctl(1, termios.TIOCGWINSZ, b' ' * 4))
|
||||
curses.resize_term(height, width)
|
||||
self.stdscr.clear()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user