From 6926ff6ae7654a53aa408cdde36a46f694a06a59 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Fri, 5 Sep 2008 00:04:23 +0000 Subject: [PATCH] more robust traceback iteration --- direct/src/showbase/ExceptionVarDump.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/direct/src/showbase/ExceptionVarDump.py b/direct/src/showbase/ExceptionVarDump.py index 6f30970391..70b21586b2 100755 --- a/direct/src/showbase/ExceptionVarDump.py +++ b/direct/src/showbase/ExceptionVarDump.py @@ -78,13 +78,13 @@ def _excepthookDumpVars(eType, eValue, tb): code = frame.f_code # this is a list of every string identifier used in this stack frame's code codeNames = code.co_names - tb = tb.tb_next # skip everything before the 'run' method, those frames have lots of # not-useful information if not foundRun: if code.co_name == 'run': foundRun = True else: + tb = tb.tb_next continue s += '\n File "%s", line %s, in %s' % ( code.co_filename, frame.f_lineno, code.co_name) @@ -137,6 +137,8 @@ def _excepthookDumpVars(eType, eValue, tb): ids.add(id(obj)) stateStack.push(['%s.%s' % (name, attrName), obj, ids]) + tb = tb.tb_next + if foundRun: s += '\n' notify.info(s)