That's exactly what `sys.__excepthook__(...)` is for: http://docs.python.org/2/library/sys.html#sys.__excepthook__