def init_crash_handler(self):
self.crash_handler = self.crash_handler_class(self)<EOL>sys.excepthook = self.excepthook<EOL>def unset_crashhandler():<EOL><INDENT>sys.excepthook = sys.__excepthook__<EOL><DEDENT>atexit.register(unset_crashhandler)<EOL>
Create a crash handler, typically setting sys.excepthook to it.