Python: eliminating stack traces into library code?

前端 未结 4 766
梦谈多话
梦谈多话 2020-12-10 16:15

When I get a runtime exception from the standard library, it\'s almost always a problem in my code and not in the library code. Is there a way to truncate the exception sta

4条回答
  •  渐次进展
    2020-12-10 16:24

    Put an unqualified try...except at the top of your code (ie: in your "main") or set sys.excepthook. You can then format the stack trace however you'd like.

提交回复
热议问题