Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import atexit
- def helloworld():
- print "Hello World!"
- atexit.register(helloworld)
- raise Exception("Good bye cruel world!")
- import sys
- import atexit
- def clear_atexit_excepthook(exctype, value, traceback):
- atexit._exithandlers[:] = []
- sys.__excepthook__(exctype, value, traceback)
- def helloworld():
- print "Hello world!"
- sys.excepthook = clear_atexit_excepthook
- atexit.register(helloworld)
- raise Exception("Good bye cruel world!")
- import os
- os._exit(0)
- import atexit
- import os
- def helloworld():
- print "Hello World!"
- atexit.register(helloworld)
- try:
- raise Exception("Good bye cruel world!")
- except Exception, e:
- print 'caught unhandled exception', str(e)
- os._exit(1)
Add Comment
Please, Sign In to add comment