From: Zac Medico Date: Sat, 5 Jul 2008 12:36:40 +0000 (-0000) Subject: Fix CompositeTask.cancel() so that it's safe to call when there is no X-Git-Tag: v2.2_rc2~197 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f1f8b974f0ef758a44a35045e01d7a1031efbbc1;p=portage.git Fix CompositeTask.cancel() so that it's safe to call when there is no running task. svn path=/main/trunk/; revision=10941 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 44f7e53e0..3ba5d01fc 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1523,7 +1523,8 @@ class CompositeTask(AsynchronousTask): def cancel(self): self._task_queue.clear() self.cancelled = True - self._current_task.cancel() + if self._current_task is not None: + self._current_task.cancel() def wait(self):