Skip to content

Commit

Permalink
Fix pymodbus-dev#657 (pymodbus-dev#659) Use _in_waiting only for seri…
Browse files Browse the repository at this point in the history
…al clients
  • Loading branch information
camtarn authored Aug 1, 2021
1 parent ff6568d commit 7c9da53
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 7c9da53

Please sign in to comment.