Errm, maybe you could use the sys.excepthook function to catch the error and then print the details yourself from the traceback object. import sys def _exceptionhook(type, value, traceback): ''' your code here ''' sys.excepthook = _exceptionhook ((untested))