Skip to content

Commit 20c1688

Browse files
Fix unreachable code in AsyncModbusTcpClient (#1151)
1 parent 61d9e9a commit 20c1688

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymodbus/client/tcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ async def _connect(self):
8989
),
9090
timeout=self.params.timeout,
9191
)
92-
return transport, protocol
9392
except Exception as exc: # pylint: disable=broad-except
9493
txt = f"Failed to connect: {exc}"
9594
_logger.warning(txt)
@@ -98,6 +97,7 @@ async def _connect(self):
9897
txt = f"Connected to {self.params.host}:{self.params.port}."
9998
_logger.info(txt)
10099
self.reset_delay()
100+
return transport, protocol
101101

102102
def protocol_made_connection(self, protocol):
103103
"""Notify successful connection."""

0 commit comments

Comments
 (0)