ソースを参照

Adding some startup bullet-proofing

Greg Wiatroski 17 年 前
コミット
5af08f799f
1 ファイル変更5 行追加3 行削除
  1. 5 3
      direct/src/task/TaskOrig.py

+ 5 - 3
direct/src/task/TaskOrig.py

@@ -1111,9 +1111,11 @@ class TaskManager:
                 self._gcTask = self.add(self._garbageCollect, TaskManager.GarbageCollectTaskName, 200)
                 self._gcTask = self.add(self._garbageCollect, TaskManager.GarbageCollectTaskName, 200)
 
 
         if not self._profileTasks:
         if not self._profileTasks:
-            from direct.fsm.StatePush import StateVar
-            self._profileTasks = StateVar(False)
-            self.setProfileTasks(getBase().config.GetBool('profile-task-spikes', 0))
+            if 'base' in __builtins__.__dict__ or \
+               'simbase' in __builtins__.__dict__:
+                from direct.fsm.StatePush import StateVar
+                self._profileTasks = StateVar(False)
+                self.setProfileTasks(getBase().config.GetBool('profile-task-spikes', 0))
 
 
         # Set the clock to have last frame's time in case we were
         # Set the clock to have last frame's time in case we were
         # Paused at the prompt for a long time
         # Paused at the prompt for a long time