Skip to content

Commit ac4ae42

Browse files
committed
Wildcard exception catch from pyserial. (#2125)
1 parent 48ae40d commit ac4ae42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pymodbus/client/serial.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ def connect(self):
218218
if self.strict:
219219
self.socket.inter_byte_timeout = self.inter_byte_timeout
220220
self.last_frame_end = None
221-
except serial.SerialException as msg:
221+
# except serial.SerialException as msg:
222+
# pyserial raises undocumented exceptions like termios
223+
except Exception as msg: # pylint: disable=broad-exception-caught
222224
Log.error("{}", msg)
223225
self.close()
224226
return self.socket is not None

0 commit comments

Comments
 (0)