fall back to default value if modules are not available (#199)
* fcntl is not available on Windows, fall back to default value * nipick order
This commit is contained in:
parent
651c997e60
commit
60910eff26
|
@ -256,6 +256,8 @@ class Printer:
|
||||||
s = struct.pack('HHHH', 0, 0, 0, 0)
|
s = struct.pack('HHHH', 0, 0, 0, 0)
|
||||||
x = fcntl.ioctl(1, termios.TIOCGWINSZ, s)
|
x = fcntl.ioctl(1, termios.TIOCGWINSZ, s)
|
||||||
width = struct.unpack('HHHH', x)[1]
|
width = struct.unpack('HHHH', x)[1]
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
if width <= 0:
|
if width <= 0:
|
||||||
|
|
Loading…
Reference in New Issue