Skip to content

Commit

Permalink
sync connect missing. (#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored Sep 9, 2023
1 parent 50d96d6 commit 580ed3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymodbus/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def execute(self, request: ModbusRequest = None) -> ModbusResponse:
:raises ConnectionException: Check exception text.
"""
if self.use_sync:
if not self.connected:
if not self.connect():
raise ConnectionException(f"Failed to connect[{self!s}]")
return self.transaction.execute(request)
if not self.transport:
Expand Down

0 comments on commit 580ed3e

Please sign in to comment.