aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/_emerge/CompositeTask.py4
-rw-r--r--lib/_emerge/SequentialTaskQueue.py3
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/_emerge/CompositeTask.py b/lib/_emerge/CompositeTask.py
index 1d199d19b..2ad1d783d 100644
--- a/lib/_emerge/CompositeTask.py
+++ b/lib/_emerge/CompositeTask.py
@@ -20,6 +20,10 @@ class CompositeTask(AsynchronousTask):
self._async_wait()
else:
self._current_task.cancel()
+ elif self.returncode is None:
+ # Assume that the task has not started yet.
+ self._was_cancelled()
+ self._async_wait()
def _poll(self):
"""
diff --git a/lib/_emerge/SequentialTaskQueue.py b/lib/_emerge/SequentialTaskQueue.py
index 318bd6c55..38ebb98d8 100644
--- a/lib/_emerge/SequentialTaskQueue.py
+++ b/lib/_emerge/SequentialTaskQueue.py
@@ -74,7 +74,10 @@ class SequentialTaskQueue(SlotObject):
"""
Clear the task queue and asynchronously terminate any running tasks.
"""
+ for task in self._task_queue:
+ task.cancel()
self._task_queue.clear()
+
for task in list(self.running_tasks):
task.cancel()