1 |
commit: 31fc2c97563eaa57ebf890d728f45f859c5520bf |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 9 08:21:24 2012 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 9 08:21:24 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=31fc2c97 |
7 |
|
8 |
QueueScheduler: fix for IpcDaemonTestCase |
9 |
|
10 |
Use a StopIteration exception to jump out of EventLoop.iterate() |
11 |
before the poll loop. |
12 |
|
13 |
--- |
14 |
pym/_emerge/QueueScheduler.py | 4 +++- |
15 |
1 files changed, 3 insertions(+), 1 deletions(-) |
16 |
|
17 |
diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py |
18 |
index 99cfb23..e34758a 100644 |
19 |
--- a/pym/_emerge/QueueScheduler.py |
20 |
+++ b/pym/_emerge/QueueScheduler.py |
21 |
@@ -38,7 +38,7 @@ class QueueScheduler(PollScheduler): |
22 |
if timeout is not None: |
23 |
def timeout_callback(): |
24 |
timeout_callback.timed_out = True |
25 |
- return False |
26 |
+ raise StopIteration() |
27 |
timeout_callback.timed_out = False |
28 |
timeout_callback.timeout_id = self.sched_iface.timeout_add( |
29 |
timeout, timeout_callback) |
30 |
@@ -53,6 +53,8 @@ class QueueScheduler(PollScheduler): |
31 |
timeout_callback.timed_out) and self._running_job_count(): |
32 |
self.sched_iface.iteration() |
33 |
|
34 |
+ except StopIteration: |
35 |
+ pass |
36 |
finally: |
37 |
if timeout_callback is not None: |
38 |
self.sched_iface.unregister(timeout_callback.timeout_id) |