mirror of https://github.com/Desuuuu/klipper.git
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:
parent
e60779bfe1
commit
d2027cb4a9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue