Skip to content

Instantly share code, notes, and snippets.

@WoLpH WoLpH/ forked from jorenham/
Last active Jan 18, 2018

What would you like to do?
Best exception handling in Python
import sys
import webbrowser
def main():
return 42/0
def excepthook(type_, value, traceback):
webbrowser.open_new_tab('[python] {} {}'.format(type_, value))
sys.__excepthook__(type_, value, traceback)
sys.excepthook = excepthook
if __name__== '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.