[Pyrex] Reraise not inside except clause

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Oct 16 08:19:29 CEST 2007


Robert Kern wrote:
> It is valid in Python to have an empty "raise" statement anywhere, and it used
> to be valid in Pyrex before 0.9.6.
>
> Can this restriction be reverted?

Not without bringing back the behaviour whereby the exception
you want to reraise can get clobbered by another exception
before you get a chance to reraise it.

Python's way of dealing with this is to save the current
exception on entry to every function and restore it afterwards.
That would be an unacceptable amount of overhead for Pyrex,
given that the overwhelming majority of function calls do not
need this to be done.

My suggestion is to think of another way to achieve whatever
it is that PyProtocols is trying to do. If you can provide
some more details about that, I may be able to help.

--
Greg



More information about the Pyrex mailing list