[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 7349 - trunk/subversion/bindings/swig

From: Russell Yanofsky <rey4_at_columbia.edu>
Date: 2003-10-14 22:34:38 CEST

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

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.