diff --git a/direct/src/gui/DirectGuiBase.py b/direct/src/gui/DirectGuiBase.py index 653d1a520b..062d7cfd41 100644 --- a/direct/src/gui/DirectGuiBase.py +++ b/direct/src/gui/DirectGuiBase.py @@ -651,7 +651,10 @@ def toggleGuiGridSnap(): def setGuiGridSpacing(spacing): DirectGuiWidget.gridSpacing = spacing -if __dev__: +# this should trigger off of __dev__, but it's not available at this point. +# __debug__ works because the production client is not __debug__ and the +# production AI doesn't create any GUI. +if config.GetBool('record-gui-creation-stack', __debug__): # this will help track down the code that created DirectGui objects # call obj.getCreationStackTrace() to figure out what code created it DirectGuiBase = recordCreationStack(DirectGuiBase) diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index 9232683dea..42392f338b 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -76,9 +76,14 @@ class Task: debugTaskTraceback = 0 # base.config.GetBool('debug-task-traceback', 0) count = 0 def __init__(self, callback, priority = 0): - if __dev__: - if self.debugTaskTraceback: - self.debugInitTraceback = StackTrace("Task "+str(callback), 1, 10) + try: + config + except: + pass + else: + if config.GetBool('record-task-creation-stack', __dev__): + if self.debugTaskTraceback: + self.debugInitTraceback = StackTrace("Task "+str(callback), 1, 10) # Unique ID for each task self.id = Task.count Task.count += 1