[Pyrex] Pyrex exception type checking broken under Python 2.5 (and earlier)

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jun 26 07:28:44 UTC 2006


Stefan Behnel wrote:

> I don't quite buy that argument - it's unlikely that it crashes, at least

Are you sure? That code is based on what the interpreter itself
does for a raise statement, and if it's performing those checks,
there's probably a reason for it.

> What Python 2.5 does is check
> that they inherit from BaseException. Since that's not available in earlier
> versions, what about checking that raised new-style objects ... inherit from
 > PyErr_Exception? I find that a reasonable restriction.

Yes, that sounds reasonable. I'll add this to my list.

--
Greg



More information about the Pyrex mailing list