diff --git a/pymodbus/client/sync.py b/pymodbus/client/sync.py index 01ca0fcbe..bb07caa52 100644 --- a/pymodbus/client/sync.py +++ b/pymodbus/client/sync.py @@ -476,7 +476,7 @@ def connect(self): _logger.error(msg) self.close() if self.method == "rtu": - if self._strict: + if self._strict and self.socket: self.socket.interCharTimeout = self.inter_char_timeout self.last_frame_end = None return self.socket is not None