Skip to content
Snippets Groups Projects
Commit 45b339ae authored by Alexandre Detiste's avatar Alexandre Detiste
Browse files

Import Upstream version 0.24.1

parent f4aa3c64
No related branches found
No related tags found
No related merge requests found
NEWS file for ttystatus
=======================
Version 0.24.1, released 2015-10-01
---------------------------------
* Fix handling the case of the process not having a terminal to talk
to. Reported by Juergen Nickelsen.
Version 0.24, released 2015-09-30
---------------------------------
......
python-ttystatus (0.24.1-1) unstable; urgency=medium
* New upstream version.
-- Lars Wirzenius <liw@liw.fi> Thu, 01 Oct 2015 19:23:22 +0300
python-ttystatus (0.24-1) unstable; urgency=low
* New upstream version.
......
......@@ -35,7 +35,7 @@ from .bytespeed import ByteSpeed
from .fmt import parse
__version__ = '0.24'
__version__ = '0.24.1'
__all__ = locals()
......@@ -53,12 +53,14 @@ class PhysicalTerminal(object):
width = 80
try:
s = struct.pack('HHHH', 0, 0, 0, 0)
x = fcntl.ioctl(self._terminal.fileno(), termios.TIOCGWINSZ, s)
width = struct.unpack('HHHH', x)[1]
except IOError:
pass
if self._terminal is not None:
try:
s = struct.pack('HHHH', 0, 0, 0, 0)
x = fcntl.ioctl(
self._terminal.fileno(), termios.TIOCGWINSZ, s)
width = struct.unpack('HHHH', x)[1]
except IOError:
pass
return width
......@@ -69,8 +71,9 @@ class PhysicalTerminal(object):
'''
try:
self._terminal.write(raw_data)
self._terminal.flush()
except IOError:
pass
if self._terminal is not None:
try:
self._terminal.write(raw_data)
self._terminal.flush()
except IOError:
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment