aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-03-15 20:45:27 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-03-16 12:49:15 -0400
commitd2027cb4a9d2fa8cfdf82964abc691df7718c1f4 (patch)
tree67c558fdd960c3e33119fd6ce40eebf8250ffecf /klippy
parente60779bfe117abdf861f65012d3fdf037b81b46c (diff)
downloadkutter-d2027cb4a9d2fa8cfdf82964abc691df7718c1f4.tar.gz
kutter-d2027cb4a9d2fa8cfdf82964abc691df7718c1f4.tar.xz
kutter-d2027cb4a9d2fa8cfdf82964abc691df7718c1f4.zip
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>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/serialhdl.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py
index 6ccd9636..ae7df4ee 100644
--- a/klippy/serialhdl.py
+++ b/klippy/serialhdl.py
@@ -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