Skip to content

Instantly share code, notes, and snippets.

@martinth
martinth / assertion_hook.py
Created August 8, 2011 21:24
A sample exception hook, that prints useful information if an AssertionError occures
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os.path
import pprint
sys._old_excepthook = sys.excepthook
def assert_hook(exc_type, exception, traceback):