From 12d0fc68c0c3b2ed01562fb616a417b2b0cdd1a1 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Mon, 7 May 2007 23:31:47 +0000 Subject: [PATCH] pdb is not published, don't crash in production --- direct/src/showbase/PythonUtil.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 130be3c77b..fa22c73ff8 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -2187,9 +2187,17 @@ def appendStr(obj, st): appendedStr = None return obj -import pdb -setTrace = pdb.set_trace -pm = pdb.pm +# convenience shortcuts for __dev__ debugging +# we don't have the __dev__ flag at this point +try: + import pdb + setTrace = pdb.set_trace + pm = pdb.pm +except: + # we're in production, there is no pdb module. assign these to something so that the + # __builtin__ exports will work + setTrace = None + pm = None class ScratchPad: """empty class to stick values onto"""