proper solution when calling removeTask with a task name

This commit is contained in:
Redmond Urbino 2007-10-23 00:38:56 +00:00
parent 923ff60d9f
commit 2716bc4cda

View File

@ -63,7 +63,11 @@ class DirectObject:
def removeTask(self, taskOrName):
if type(taskOrName) == type(''):
taskMgr.remove(taskOrName)
# we must use a copy, since task.remove will modify self._taskList
taskListValues = self._taskList.values()
for task in taskListValues:
if task.name == taskOrName:
task.remove()
else:
taskOrName.remove()