diff options
Diffstat (limited to 'test/py/u_boot_spawn.py')
-rw-r--r-- | test/py/u_boot_spawn.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 0f52d3e945..4b9e81af3e 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -148,10 +148,14 @@ class Spawn(object): self.buf = self.buf[posafter:] return earliest_pi tnow_s = time.time() - tdelta_ms = (tnow_s - tstart_s) * 1000 - if tdelta_ms > self.timeout: - raise Timeout() - events = self.poll.poll(self.timeout - tdelta_ms) + if self.timeout: + tdelta_ms = (tnow_s - tstart_s) * 1000 + poll_maxwait = self.timeout - tdelta_ms + if tdelta_ms > self.timeout: + raise Timeout() + else: + poll_maxwait = None + events = self.poll.poll(poll_maxwait) if not events: raise Timeout() c = os.read(self.fd, 1024) |