给定一个Exception对象(来源不明)有没有办法获得它的追溯?我有这样的代码:
def stuff():
try:
.....
return useful
except Exception as e:
return e
result = stuff()
if isinstance(result, Exception):
result.traceback <-- How?
Run Code Online (Sandbox Code Playgroud)
有了它,如何从Exception对象中提取回溯?