serialhdl: Catch IOError in connect_canbus()

It seems the can library on Python2 can sometimes raise an IOError
exception on a failure.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor committed 2024-07-05 20:16:21 -04:00
1 parent 34732f857a
commit 00cb683def
1 file changed
+1 -1
+1 -1
View File
@@ -136,7 +136,7 @@ class SerialReader:
can_filters=filters,
bustype='socketcan')
bus.send(set_id_msg)
except (can.CanError, os.error) as e:
except (can.CanError, os.error, IOError) as e:
logging.warning("%sUnable to open CAN port: %s",
self.warn_prefix, e)
self.reactor.pause(self.reactor.monotonic() + 5.)