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>
Wed, 27 Oct 2010 14:37:43 +0000 (07:37 -0700)
pym/_emerge/Scheduler.py

index 33e3379fbb1f7efcc155752a740f0947f2a98db2..a6662a1d03365d58f7a0583746eb6307b86467f3 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()