summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/CompositeTask.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index 4667b7813..b5e8ce5bb 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -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.