Created
October 4, 2016 12:52
-
-
Save whosaysni/8330b6d1e17e6a68675d557ba5acc5b5 to your computer and use it in GitHub Desktop.
例外をプギャーする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> sys.excepthook = lambda y,v,r: sys.stderr.write(u'プギャー m9 (^д^)9m <{}\n'.format(y.__name__)) | |
>>> 1/0 | |
プギャー m9 (^д^)9m <ZeroDivisionError | |
>>> 'asdf' + 1 | |
プギャー m9 (^д^)9m <TypeError | |
>>> __import__('math').sqrt(-1) | |
プギャー m9 (^д^)9m <ValueError | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment