[Python-3000] Custom traceback entries (Exception tracebacks and PEP 3101)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 6 23:15:56 CET 2007


Patrick Maupin wrote:
> I'm not sure that I can
> legitimately add to a preexisting traceback from a C function in a
> non-fragile fashion.

Pyrex does this by creating a fake stack frame and
filling most of it in with dummy values. It can be
done, but it's ugly. Let me know if you're interested
and I'll send you the code.

I'd like a better way to do this, too. Seems to me
the traceback object ought to have an abstract
interface for getting the info needed to print the
traceback. Then you could easily put custom
entries in the traceback showing whatever you
wanted.

--
Greg


More information about the Python-3000 mailing list