Skip to content

Commit

Permalink
Fix #657 (#659) Use _in_waiting only for serial clients
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoomakethu authored Aug 1, 2021
1 parent 9e731d8 commit 52037bf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pymodbus/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,12 @@ def _retry_transaction(self, retries, reason,
time.sleep(delay)
_logger.debug("Sleeping {}".format(delay))
self.client.connect()
in_waiting = self.client._in_waiting()
if in_waiting:
if response_length == in_waiting:
result = self._recv(response_length, full)
return result, None
if hasattr(self.client, "_in_waiting"):
in_waiting = self.client._in_waiting()
if in_waiting:
if response_length == in_waiting:
result = self._recv(response_length, full)
return result, None
return self._transact(packet, response_length, full=full)

def _transact(self, packet, response_length,
Expand Down

0 comments on commit 52037bf

Please sign in to comment.