Fix Python3 support

This commit is contained in:
Mitchell Stokes 2016-05-14 20:43:05 -07:00 committed by rdb
parent d73d02fc27
commit 74d588696c
1 changed files with 3 additions and 6 deletions

View File

@ -397,7 +397,6 @@ class TaskManager:
'Task %s does not accept arguments.' % (repr(task)))
if name is not None:
assert isinstance(name, basestring), 'Name must be a string type'
task.setName(name)
assert task.hasName()
@ -431,16 +430,14 @@ class TaskManager:
all tasks with the indicated name are removed. Returns the
number of tasks removed. """
if isinstance(taskOrName, basestring):
tasks = self.mgr.findTasks(taskOrName)
return self.mgr.remove(tasks)
elif isinstance(taskOrName, AsyncTask):
if isinstance(taskOrName, AsyncTask):
return self.mgr.remove(taskOrName)
elif isinstance(taskOrName, list):
for task in taskOrName:
self.remove(task)
else:
self.notify.error('remove takes a string or a Task')
tasks = self.mgr.findTasks(taskOrName)
return self.mgr.remove(tasks)
def removeTasksMatching(self, taskPattern):
"""Removes all tasks whose names match the pattern, which can