serialhdl: Catch SerialException as well as OSError on serial open

Catch the right exceptions so that a retry is possible when attempting
to open the serial port.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor committed 2017-03-16 12:49:15 -04:00
1 parent e60779bfe1
commit d2027cb4a9
1 file changed
+1 -1
+1 -1
View File
@@ -65,7 +65,7 @@ class SerialReader:
starttime = self.reactor.monotonic()
try:
self.ser = serial.Serial(self.serialport, self.baud, timeout=0)
except OSError, e:
except (OSError, serial.SerialException), e:
logging.warn("Unable to open port: %s" % (e,))
self.reactor.pause(starttime + 5.)
continue