Skip to content

Commit

Permalink
W 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Oct 10, 2023
1 parent 2a49b79 commit 59f9566
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pymodbus/transport/transport_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ def _read_ready(self):
"""Test if there are data waiting."""
try:
data = self.sync_serial.read(1024)
except serial.SerialException as exc:
self.close(exc=exc)
else:
if data:
self._protocol.data_received(data)
except serial.SerialException as exc:
self.close(exc=exc)

def _write_ready(self):
"""Asynchronously write buffered data."""
Expand Down

0 comments on commit 59f9566

Please sign in to comment.