Guest User

Untitled

a guest
Dec 12th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # Back up the reference to the exceptionhook
  2. sys._excepthook = sys.excepthook
  3.  
  4. def my_exception_hook(exctype, value, traceback):
  5. # Print the error and traceback
  6. print(exctype, value, traceback)
  7. # Call the normal Exception hook after
  8. sys._excepthook(exctype, value, traceback)
  9. sys.exit(1)
  10.  
  11. # Set the exception hook to our wrapping function
  12. sys.excepthook = my_exception_hook
Add Comment
Please, Sign In to add comment