# HG changeset patch # User Paul Boddie # Date 1423585583 -3600 # Node ID 82f4dfc693c0cf4034327e2af9dfc3d8653d2b41 # Parent 1b3168ab5512545db82c32bbe3260ab7408e1439 Made error messages a lot more helpful at last. diff -r 1b3168ab5512 -r 82f4dfc693c0 imiptools/__init__.py --- a/imiptools/__init__.py Tue Feb 10 16:43:16 2015 +0100 +++ b/imiptools/__init__.py Tue Feb 10 17:26:23 2015 +0100 @@ -288,7 +288,12 @@ if "-v" in args: raise type, value, tb = sys.exc_info() - print >>sys.stderr, "Exception %s at %d" % (exc, tb.tb_lineno) + while tb.tb_next: + tb = tb.tb_next + f = tb.tb_frame + co = f and f.f_code + filename = co and co.co_filename + print >>sys.stderr, "Exception %s at %d in %s" % (exc, tb.tb_lineno, filename) #import traceback #traceback.print_exc(file=open("/tmp/mail.log", "a")) sys.exit(EX_TEMPFAIL)