如何收集traceback

try:

  ...

except:
exc_type, exc_value, tb = sys.exc_info()
# Save the traceback and attach it to the exception object
exc_lines = traceback.format_exception(exc_type,
exc_value,
tb)
exc_value.child_traceback = ''.join(exc_lines)
posted @ 2017-07-18 20:17  notlate  阅读(189)  评论(0)    收藏  举报