CompositeTask: fix assertion in _wait
authorZac Medico <zmedico@gentoo.org>
Thu, 17 Mar 2011 01:42:59 +0000 (18:42 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 17 Mar 2011 01:42:59 +0000 (18:42 -0700)
pym/_emerge/CompositeTask.py

index 4667b781343159b207ff62fb59305ee42dd6040d..b5e8ce5bbf2db174db92e7b96814f1cb6da84d3a 100644 (file)
@@ -49,6 +49,11 @@ class CompositeTask(AsynchronousTask):
                                # don't wait for the same task more than once
                                break
                        if task is prev:
+                               if self.returncode is not None:
+                                       # This is expected if we're being
+                                       # called from the task's exit listener
+                                       # after it's been cancelled.
+                                       break
                                # 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.