Skip to content

Commit f190c7b

Browse files
committed
microscope/_utils.py (SharedSerial.read_until): fix for pySerial >= 3.5 (#233)
pySerial 3.5 changed the argument name for the read_until method. There was no change behaviour, only the parameter name changed. This commit calls read_until with positional arguments to avoid the name change issue.
1 parent ccc2d9c commit f190c7b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

microscope/_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ def readlines(self, hint: int = -1) -> typing.List[bytes]:
110110
with self._lock:
111111
return self._serial.readlines(hint)
112112

113+
# Beware: pySerial 3.5 changed the named of its first argument
114+
# from terminator to expected. See issue #233.
113115
def read_until(
114116
self, terminator: bytes = b"\n", size: typing.Optional[int] = None
115117
) -> bytes:
116118
with self._lock:
117-
return self._serial.read_until(terminator=terminator, size=size)
119+
return self._serial.read_until(terminator, size=size)
118120

119121
def write(self, data: bytes) -> int:
120122
with self._lock:

0 commit comments

Comments
 (0)