Fix CompositeTask.cancel() so that it's safe to call when there is no
authorZac Medico <zmedico@gentoo.org>
Sat, 5 Jul 2008 12:36:40 +0000 (12:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 5 Jul 2008 12:36:40 +0000 (12:36 -0000)
running task.

svn path=/main/trunk/; revision=10941

pym/_emerge/__init__.py

index 44f7e53e063d00cdec65553297c5159fc720036a..3ba5d01fc257dc581f766e9660a415ce9a7c08cf 100644 (file)
@@ -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):