Jacob Kaplan-Moss wrote: > > Howdy -- > > I'm about halfway done with an error middleware that handles this, but > my knowledge of how tracebacks/exceptions work is rusty. Can anyone > point me to information about how to extract the source code context > from a traceback frame? That's the only component I don't have yet. > > Jacob >
The traceback module http://docs.python.org/lib/module-traceback.html is your best bet. The important function to look at is extract_tb.