[Python-Dev] Exception masking/chaining
Greg Ewing
greg@cosc.canterbury.ac.nz
Thu, 12 Jun 2003 16:28:59 +1200 (NZST)
Guido:
> More globals of course defeat the purpose (one of the reasons for
> putting the traceback in the exception is to get rid of
> sys.exc_traceback).
I think the idea was that this would be a C-level global,
not a Python one (i.e. part of the existing group of
C variables representing the current exception state).
> I also think that doing this automatically whenever PyErr_Set*() is
> called would cause a lot of spurious tracebacks. (Unless the idea is
> to skip the chaining if the original exception has an empty
> traceback
I don't understand that. What is a "spurious" traceback? And how
are you going to get one if the current traceback is empty?
> I worry about backwards compatibility.
What would this break? Code which doesn't know about chained
exceptions can just ignore the new attribute and get exactly
the information they used to get from the exception and its
traceback, as far as I can see.
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg@cosc.canterbury.ac.nz +--------------------------------------+