Re: excepthook doesn't give exact line number

2006-10-05 Thread Hari Sekhon
Thanks for the pointer, I've now got this giving me the right line number when an exception occurs, although I still get an empty stack trace from print "Stack Trace:\n%s\n" % str(traceback.print_exc(2)) inside the excepthook. Any ideas why this is? Is there no traceback since the tracebac

Re: excepthook doesn't give exact line number

2006-10-05 Thread Hari Sekhon
I've tried the sample code you provided but it seems to just hang, it must be doing something but unfortunately it must take too long, by which time a second control-c gives an awful dual traceback message showing the original traceback and the new one from the tbiter() func. I've tried a few

Re: excepthook doesn't give exact line number

2006-10-03 Thread Peter Otten
Hari Sekhon wrote: > The problem is that the excepthook gives the line of the topmost called > function rather that the actual line that generated the error the way > you get it with a normal traceback. A look into the traceback module shows that tracebacks are stored as a linked list. Here's a w

excepthook doesn't give exact line number

2006-10-03 Thread Hari Sekhon
Hi, I'm wondering if anyone can please help me on figuring out a better way of doing an excepthook. I have a script which is using an excepthook to catch any uncaught exceptions - there usually aren't any except when I am messing with the code, like right now :-) The problem is that the exce