Skip to content

Commit cd346bd

Browse files
As per merge request suggestion
Co-authored-by: zariiii9003 <52598363+zariiii9003@users.noreply.github.com>
1 parent f73df21 commit cd346bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

can/interfaces/slcan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def _read(self, timeout: float | None) -> str | None:
218218
while True:
219219
# Due to accessing `serialPortOrig.in_waiting` too often will reduce the performance.
220220
# We read the `serialPortOrig.in_waiting` only once here.
221-
in_waiting = self.serialPortOrig.in_waiting
221+
size = self.serialPortOrig.in_waiting or 1
222222
if in_waiting > 0:
223223
self._buffer.extend(self.serialPortOrig.read(in_waiting))
224224
else:

0 commit comments

Comments
 (0)