This fixes EventLoop.iteration() so that it doesn't poll too long when
there are timeouts registered, since it's not nice to spend a long time
polling for an IO event that might never arrive even though a timeout
may have changed some state that would terminate a timeout loop like
in QueueScheduler.run() or AbstractPollTask._wait_loop(). This makes
EventLoop.iteration() behave more like GlibEventLoop.iteration().
if not self._poll_event_queue:
if may_block:
- timeout = None
+ timeout = self._timeout_interval
else:
timeout = 0
self._poll(timeout=timeout)