fix exception when mini-task explicitly removes itself

This commit is contained in:
David Rose 2009-01-09 19:19:35 +00:00
parent d6d497106a
commit 9e5e3edc5b

View File

@ -26,7 +26,10 @@ class MiniTaskManager:
self.taskList.append(task)
def remove(self, task):
self.taskList.remove(task)
try:
self.taskList.remove(task)
except ValueError:
pass
def __executeTask(self, task):
return task(task)
@ -44,7 +47,10 @@ class MiniTaskManager:
else:
# Remove the task
self.taskList.remove(task)
try:
self.taskList.remove(task)
except ValueError:
pass
# Do not increment the iterator
continue