Raise StopIteration from _poll() if needed.
authorZac Medico <zmedico@gentoo.org>
Tue, 26 Oct 2010 18:48:42 +0000 (11:48 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 26 Oct 2010 18:48:42 +0000 (11:48 -0700)
pym/_emerge/Scheduler.py

index 874a4fd7303f3f918a874f92f9b58fff66629231..dfa73c94879ab73912832e57cdac9ee4449e6d99 100644 (file)
@@ -325,6 +325,11 @@ class Scheduler(PollScheduler):
 
                if timeout is None:
                        while True:
+                               if not self._poll_event_handlers:
+                                       self._schedule()
+                                       if not self._poll_event_handlers:
+                                               raise StopIteration(
+                                                       "timeout is None and there are no poll() event handlers")
                                previous_count = len(self._poll_event_queue)
                                PollScheduler._poll(self, timeout=self._max_display_latency)
                                self._status_display.display()