Skip to content

Commit b0fa0a4

Browse files
committed
save extra exc_info when dump traceback
1 parent b80f59f commit b0fa0a4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pydumpling/pydumpling.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,20 @@
1414
def save_dumping(filename=None, tb=None):
1515
try:
1616
if tb is None:
17-
tb = sys.exc_info()[2]
17+
exc_type, exc_value, exc_tb = sys.exc_info()
1818

1919
if filename is None:
2020
filename = "%s:%d.dump" % (
21-
tb.tb_frame.f_code.co_filename, tb.tb_frame.f_lineno)
21+
exc_tb.tb_frame.f_code.co_filename, exc_tb.tb_frame.f_lineno)
2222

23-
fake_tb = FakeTraceback(tb)
23+
fake_tb = FakeTraceback(exc_tb)
2424
dumpling = {
2525
"traceback": fake_tb,
2626
"version": __version__,
27+
"exc_extra": {
28+
"exc_type": exc_type,
29+
"exc_value": exc_value,
30+
},
2731
"dump_type": "DILL"
2832
}
2933
with gzip.open(filename, "wb") as f:

0 commit comments

Comments
 (0)