monkeyfarmer: Make polling even more robust

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-08-03 13:15:28 +01:00
parent 41ecb495d0
commit 6826e5d612

View File

@ -148,10 +148,10 @@ class MonkeyFarmer(asyncore.dispatcher):
asyncore.loop(timeout=next_event - now, count=1)
else:
asyncore.loop(count=1)
if len(self.lines) > 0:
while len(self.lines) > 0:
self.monkey_says(self.lines.pop(0))
if once:
break
if once or self.deadmonkey:
return
class Browser: