Skip to content

Instantly share code, notes, and snippets.

@xcodebuild
Created July 28, 2015 03:16
Show Gist options
  • Save xcodebuild/3fef2c1e6eb109a91977 to your computer and use it in GitHub Desktop.
Save xcodebuild/3fef2c1e6eb109a91977 to your computer and use it in GitHub Desktop.
import sys
class ExceptionHook:
instance = None
def __call__(self, *args, **kwargs):
if self.instance is None:
from IPython.core import ultratb
self.instance = ultratb.FormattedTB(mode='Plain',
color_scheme='Linux', call_pdb=1)
return self.instance(*args, **kwargs)
sys.excepthook = ExceptionHook()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment