mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
progressbar.py: Ignore 'inappropriate ioctl for device' exceptions when resizing window.
This commit is contained in:
parent
4e8ec61e11
commit
363bf09254
11
debian/tools/progressbar.py
vendored
11
debian/tools/progressbar.py
vendored
@ -29,9 +29,14 @@ import termios
|
||||
def _sig_winch(signum=None, frame=None):
|
||||
"""Signal handler for SIGWINCH."""
|
||||
global _term_width
|
||||
h, w, hp, wp = struct.unpack('HHHH', fcntl.ioctl(sys.stdout.fileno(),
|
||||
termios.TIOCGWINSZ, struct.pack('HHHH', 0, 0, 0, 0)))
|
||||
_term_width = w
|
||||
try:
|
||||
h, w, hp, wp = struct.unpack('HHHH', fcntl.ioctl(sys.stdout.fileno(),
|
||||
termios.TIOCGWINSZ, struct.pack('HHHH', 0, 0, 0, 0)))
|
||||
_term_width = w
|
||||
except IOError:
|
||||
# ignore 'IOError: [Errno 25] Inappropriate ioctl for device',
|
||||
# which can occur when resizing the window while the output is redirected
|
||||
pass
|
||||
|
||||
try:
|
||||
_sig_winch()
|
||||
|
Loading…
x
Reference in New Issue
Block a user