From d5548fa4ae0857e28569289b5cafdf55bb0a3eff 2011-10-14 22:39:50 From: MinRK Date: 2011-10-14 22:39:50 Subject: [PATCH] prevent atexit handlers from generating crash report register `sys.excepthook = sys.__excepthook__` with atexit on aplication startup, so it should be the first handler called. This removes the crash handler. closes #207 --- diff --git a/IPython/core/application.py b/IPython/core/application.py index 7d6e4bc..5679aa7 100644 --- a/IPython/core/application.py +++ b/IPython/core/application.py @@ -27,6 +27,7 @@ Authors: # Imports #----------------------------------------------------------------------------- +import atexit import glob import logging import os @@ -156,6 +157,9 @@ class BaseIPythonApplication(Application): """Create a crash handler, typically setting sys.excepthook to it.""" self.crash_handler = self.crash_handler_class(self) sys.excepthook = self.crash_handler + def unset_crashhandler(): + sys.excepthook = sys.__excepthook__ + atexit.register(unset_crashhandler) def _ipython_dir_changed(self, name, old, new): if old in sys.path: