_line_or_await *after* checking wait_fors so we don't match current line

This commit is contained in:
jesopo 2020-04-23 14:53:28 +01:00
parent 45269a98a9
commit f48aaded5a

View file

@ -192,7 +192,6 @@ class Server(IServer):
await self._on_read_line(line)
await self.line_read(line)
await self._line_or_wait(_line())
for i, (aw, response, fut) in enumerate(self._wait_for):
if response.match(self, line):
fut.set_result(line)
@ -200,6 +199,8 @@ class Server(IServer):
await self._line_or_wait(aw)
break
await self._line_or_wait(_line())
return both
async def wait_for(self, response: IMatchResponse) -> Line: