wrapping all class methods
Robin Becker
robin at jessikat.fsnet.co.uk
Fri Nov 15 19:40:20 EST 2002
In article <ar3vgn$d0g$2 at solaris.cc.vt.edu>, Carl Banks <imbosol at vt.edu>
writes
>Robin Becker wrote:
>> ..... it seems I was asking a question that Python cannot answer as
>> traceback.print_exc() will only print a traceback back to the point
>> at which it's caught. The stack frames are there and can be listed
>> further, but I don't think that the line number information is
>> always good beyond the exception handler.
>
>
>Since you're using anygui, maybe it would be more helpful to wrap your
>callbacks. The Python GUIs I've used (gtk and tkinter) swallow
>exceptions that reach the event loop, which seems typical, but they do
>print the traceback to stdout. Maybe anygui doesn't even print the
>traceback, or maybe it't not showing up in your programming
>environment.
>
>
>
well actually I'm debugging a backend for anygui and yes you're right it
often swallows stuff. I wanted to wrap all methods without doing a huge
amount of work. The traceback going back only to the handler is a pain
since we might need to know who invoked the method. Using the frame
chain I can now get quite accurate information. It's a pity it's not
rock solid though.
--
Robin Becker
More information about the Python-list
mailing list