Browse files

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
  • Loading branch information...
1 parent 0d065b1 commit d5548fa4ae0857e28569289b5cafdf55bb0a3eff @minrk minrk committed Oct 14, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 IPython/core/application.py
View
4 IPython/core/application.py
@@ -27,6 +27,7 @@
# Imports
#-----------------------------------------------------------------------------
+import atexit
import glob
import logging
import os
@@ -156,6 +157,9 @@ def init_crash_handler(self):
"""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:

0 comments on commit d5548fa

Please sign in to comment.