Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Back up the reference to the exceptionhook
- sys._excepthook = sys.excepthook
- def my_exception_hook(exctype, value, traceback):
- # Print the error and traceback
- print(exctype, value, traceback)
- # Call the normal Exception hook after
- sys._excepthook(exctype, value, traceback)
- sys.exit(1)
- # Set the exception hook to our wrapping function
- sys.excepthook = my_exception_hook
Add Comment
Please, Sign In to add comment