From 074918c3f1f9d019b63fb363f8fc42253d03e15e 2011-10-22 18:38:51 From: MinRK Date: 2011-10-22 18:38:51 Subject: [PATCH] unregister crash handler on call prevents recursive invocation of the crash handler --- diff --git a/IPython/core/crashhandler.py b/IPython/core/crashhandler.py index 87312ef..0774ac2 100644 --- a/IPython/core/crashhandler.py +++ b/IPython/core/crashhandler.py @@ -110,7 +110,12 @@ class CrashHandler(object): def __call__(self, etype, evalue, etb): """Handle an exception, call for compatible with sys.excepthook""" - + + # do not allow the crash handler to be called twice without reinstalling it + # this prevents unlikely errors in the crash handling from entering an + # infinite loop. + sys.excepthook = sys.__excepthook__ + # Report tracebacks shouldn't use color in general (safer for users) color_scheme = 'NoColor'