On 2/11/07, "Martin v. Löwis" <[EMAIL PROTECTED]> 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. -Brett _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
