summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/__init__.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-08 17:26:46 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-08 17:26:46 +0000
commit367d276d54ef1aeda5bb630577fa73a470e51ae0 (patch)
treeddced3e414d70b382a99b5a19d914c0f96ae9373 /pym/_emerge/__init__.py
parent572fc99bdcd57c911c60f767688f597a23cbe2ef (diff)
downloadportage-367d276d54ef1aeda5bb630577fa73a470e51ae0.tar.gz
portage-367d276d54ef1aeda5bb630577fa73a470e51ae0.tar.bz2
portage-367d276d54ef1aeda5bb630577fa73a470e51ae0.zip
Raise an AssertionError in CompositeTask._wait() if it's detected that
self._current_task hasn't been properly updated after calling wait on it. svn path=/main/trunk/; revision=10987
Diffstat (limited to 'pym/_emerge/__init__.py')
-rw-r--r--pym/_emerge/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index f0a0a687c..c5d6c402f 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1582,9 +1582,15 @@ class CompositeTask(AsynchronousTask):
prev = None
while True:
task = self._current_task
- if task is None or task is prev:
+ if task is None:
# don't wait for the same task more than once
break
+ if task is prev:
+ # Before the task.wait() method returned, an exit
+ # listener should have set self._current_task to either
+ # a different task or None. Something is wrong.
+ raise AssertionError("self._current_task has not " + \
+ "changed since calling wait", self, task)
task.wait()
prev = task