From 6c83957036f93372801ed1d7bf1076d82f9785c5 Mon Sep 17 00:00:00 2001 From: cliechti Date: Wed, 5 Aug 2009 23:40:50 +0000 Subject: 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 --- examples/miniterm.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'examples') 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""" -- cgit v1.2.1