mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
print stacktrace before variable dump in case the process crashes while creating variable dump
This commit is contained in:
parent
36b6f93353
commit
7583ac4861
@ -4,6 +4,7 @@ from direct.showbase.PythonUtil import fastRepr
|
|||||||
from exceptions import Exception
|
from exceptions import Exception
|
||||||
import sys
|
import sys
|
||||||
import types
|
import types
|
||||||
|
import traceback
|
||||||
|
|
||||||
notify = directNotify.newCategory("ExceptionVarDump")
|
notify = directNotify.newCategory("ExceptionVarDump")
|
||||||
|
|
||||||
@ -69,6 +70,11 @@ class _AttrNotFound:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def _excepthookDumpVars(eType, eValue, tb):
|
def _excepthookDumpVars(eType, eValue, tb):
|
||||||
|
excStrs = traceback.format_exception(eType, eValue, tb)
|
||||||
|
s = 'printing traceback in case variable repr crashes the process...\n'
|
||||||
|
for excStr in excStrs:
|
||||||
|
s += excStr
|
||||||
|
notify.info(s)
|
||||||
s = 'DUMPING STACK FRAME VARIABLES'
|
s = 'DUMPING STACK FRAME VARIABLES'
|
||||||
origTb = tb
|
origTb = tb
|
||||||
#import pdb;pdb.set_trace()
|
#import pdb;pdb.set_trace()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user