Message340311
The difference is because you grabbed and print()ed the exception themselves in Script 2, while in Script 1 you let Python's built-in unhandled exception handler (sys.excepthook) print the traceback for you.
If you want a traceback, then you need to print it yourself. Try something along the lines of this:
traceback.print_tb(result.__traceback__)
or:
traceback.print_exception(type(result), result, result.__traceback__)
or if you use the logging module:
logging.error('Unexpected exception', exc_info=result)
reference: https://stackoverflow.com/questions/11414894/extract-traceback-info-from-an-exception-object |
|
Date |
User |
Action |
Args |
2019-04-16 05:53:36 | twisteroid ambassador | set | recipients:
+ twisteroid ambassador, asvetlov, yselivanov, Drew Budwin |
2019-04-16 05:53:36 | twisteroid ambassador | set | messageid: <1555394016.95.0.370630220693.issue36636@roundup.psfhosted.org> |
2019-04-16 05:53:36 | twisteroid ambassador | link | issue36636 messages |
2019-04-16 05:53:36 | twisteroid ambassador | create | |
|