Ensure wait_for_line() is not called with timeout=0

(cherry picked from commit 1770b37095)
This commit is contained in:
Michał Kępień
2023-12-19 11:10:04 +01:00
committed by Michal Nowak
parent 93b4b110a7
commit b09835a5d1

View File

@@ -227,6 +227,7 @@ class WatchLog(abc.ABC):
if not self._fd:
raise WatchLogException("No file to watch")
leftover = ""
assert timeout, "Do not use this class unless you want to WAIT for something."
deadline = time.time() + timeout
while time.time() < deadline:
for line in self._fd.readlines():