From 74d588696c3171acd025fe9cfd7c52d148472f4a Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sat, 14 May 2016 20:43:05 -0700 Subject: [PATCH] Fix Python3 support --- direct/src/task/Task.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index 3ee0f2fc2e..300be02f71 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -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