From 31fc2c97563eaa57ebf890d728f45f859c5520bf Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 9 Feb 2012 00:21:24 -0800 Subject: [PATCH] QueueScheduler: fix for IpcDaemonTestCase Use a StopIteration exception to jump out of EventLoop.iterate() before the poll loop. --- pym/_emerge/QueueScheduler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py index 99cfb23a8..e34758a85 100644 --- a/pym/_emerge/QueueScheduler.py +++ b/pym/_emerge/QueueScheduler.py @@ -38,7 +38,7 @@ class QueueScheduler(PollScheduler): if timeout is not None: def timeout_callback(): timeout_callback.timed_out = True - return False + raise StopIteration() timeout_callback.timed_out = False timeout_callback.timeout_id = self.sched_iface.timeout_add( timeout, timeout_callback) @@ -53,6 +53,8 @@ class QueueScheduler(PollScheduler): timeout_callback.timed_out) and self._running_job_count(): self.sched_iface.iteration() + except StopIteration: + pass finally: if timeout_callback is not None: self.sched_iface.unregister(timeout_callback.timeout_id) -- 2.26.2