[Python-3000] how should we handle changes to the C API?
brett at python.org
Sun Feb 11 20:30:24 CET 2007
On 2/11/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Brett Cannon schrieb:
> > My specific need is that PyErr_GivenExceptionMatches() does not have
> > an exception return value. This sucks for me in 2.6 for deprecating
> > catching string exceptions, but it sucks more in 3.0 since only
> > subclasses of BaseException can be raised. But not allowing -1 to
> > represent that an error occurred is a pain for anyone who wants to
> > properly use the function.
> I don't understand what exceptional value you are talking about.
> If the given object cannot be an exception, it clearly doesn't
> match, so the outcome should be zero (not an error).
Right, but I wanted to be able to raise a warning. If that warning is
supposed to be treated as an exception the caller needs to let that
propagate. RIght now PyErr_GivenExceptionMatches() can in no way let
the caller know that fact; the caller need to use PyErr_Occurred()
after the call. I checked and no one does that in the core or in 3rd
party libraries from a Google Code search I did.
More information about the Python-3000