summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-08-05 23:40:50 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-08-05 23:40:50 +0000
commit6c83957036f93372801ed1d7bf1076d82f9785c5 (patch)
treea6c6b5f0476526cc7a9ceb626f632a8ce1370195 /examples
parent5d8d5ba08e6d80bfd2152805f38cfce95b39b036 (diff)
downloadpyserial-6c83957036f93372801ed1d7bf1076d82f9785c5.tar.gz
ignore error for status lines in info display
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@306 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'examples')
-rw-r--r--examples/miniterm.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/examples/miniterm.py b/examples/miniterm.py
index 25b1e44..7290783 100644
--- a/examples/miniterm.py
+++ b/examples/miniterm.py
@@ -176,12 +176,17 @@ class Miniterm:
sys.stderr.write('--- hardware flow control %s\n' % (self.serial.rtscts and 'active' or 'inactive'))
sys.stderr.write('--- data escaping: %s\n' % (REPR_MODES[self.repr_mode],))
sys.stderr.write('--- linefeed: %s\n' % (LF_MODES[self.convert_outgoing],))
- sys.stderr.write('--- CTS: %s DSR: %s RI: %s CD: %s\n' % (
- (self.serial.getCTS() and 'active' or 'inactive'),
- (self.serial.getDSR() and 'active' or 'inactive'),
- (self.serial.getRI() and 'active' or 'inactive'),
- (self.serial.getCD() and 'active' or 'inactive'),
- ))
+ try:
+ sys.stderr.write('--- CTS: %s DSR: %s RI: %s CD: %s\n' % (
+ (self.serial.getCTS() and 'active' or 'inactive'),
+ (self.serial.getDSR() and 'active' or 'inactive'),
+ (self.serial.getRI() and 'active' or 'inactive'),
+ (self.serial.getCD() and 'active' or 'inactive'),
+ ))
+ except serial.SerialException:
+ # on RFC 2217 ports it can happen to no modem state notification was
+ # yet received. ignore this error.
+ pass
def reader(self):
"""loop and copy serial->console"""