[Python-Dev] Traceback problem

Guido van Rossum guido@python.org
Mon, 24 Feb 2003 13:12:26 -0500


> Guido van Rossum wrote:
> > If I understand correctly what you are referring to, this is a
> > feature.  You're supposed to say:
> > 
> >   try:
> >     return f()
> >   except:
> >     pass
> >   sys.exc_info()
> > 
> > i.e. the exc_info() must remain accessible.

[Christian]
> Aha! Yup! Thanks.
> 
> Then, it is probably not a bug but a feature.
> Would it be ok then, if I write a function
> that exposes reset_exc_info to the user?
> 
> sys.exc_clear() # maybe?
> 
> Or a function which returns *and* clears the exc?
> 
> tup = sys.exc_info_reset()

Sure, as long as it is part of Stackless and not of Python proper.

--Guido van Rossum (home page: http://www.python.org/~guido/)