[Python-Dev] Exception masking/chaining

Walter Dörwald walter@livinglogic.de
Thu, 12 Jun 2003 16:55:23 +0200


Guido van Rossum wrote:

> [...]
>>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 was imagining that the default mechanism for printing tracebacks
> would always try to follow the chain of tracebacks, and report not
> just the traceback, but also the exception that was replaced.  There's
> a lot of C code out there that catches e.g. AttributeError and
> replaces it with a more specific error (e.g. BifurcationError("can't
> bifurcate the sploorg") replacing AttributeError("__bifurcate__").
> I think this would cause end user confusion.

Isn't the new sys.exc_clear() usable for that? (I.e. raising
a fresh exception without any chained ones?)

> [...]

Bye,
    Walter Dörwald