Greg Stein wrote:
> On Wed, Oct 08, 2003 at 12:56:35AM -0500, rey4@tigris.org wrote:
>> ...
>> + acquire_py_lock();
>> + /* ### shouldn't we set an exception if this fails? */
>
> Nope. The status callback has a "void" return type. It doesn't want
> any errors to be raised.
>
> That said, it is an interesting question: may it *should* return an
> error.
>
>> + if ((result = PyObject_CallFunction(function, (char *)"sO&", path,
>> + make_ob_status, status)) !=
>> NULL) + {
>> + Py_DECREF(result);
>> }
>
> I'd restructure as:
>
> if ((result = PyObject_CallFunction(...)) == NULL)
> {
> /* ignore the exception that was raised */
> PyErr_Clear();
> }
> else
> {
> Py_DECREF(result);
> }
>
> You *really* don't want to leave an exception hanging about.
Ok. But isn't there any to way to propagate the exception? Python errors
shouldn't vanish into the abyss just because the C function returns void.
- Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 14 22:51:28 2003