diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-03-15 20:45:27 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-03-16 12:49:15 -0400 |
commit | d2027cb4a9d2fa8cfdf82964abc691df7718c1f4 (patch) | |
tree | 67c558fdd960c3e33119fd6ce40eebf8250ffecf | |
parent | e60779bfe117abdf861f65012d3fdf037b81b46c (diff) | |
download | kutter-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>
-rw-r--r-- | klippy/serialhdl.py | 2 |
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 |