[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 3574 - trunk/subversion/bindings/swig

From: <cmpilato_at_collab.net>
Date: 2002-10-31 15:35:19 CET

Greg Stein <gstein@lyra.org> writes:

> > /* -----------------------------------------------------------------------
> > + make return commit item structures magically turn into a 3-tuple of
> > + (rev, datestring, author).
> > +*/
> > +%typemap(python,argout,fragment="t_output_helper") svn_client_commit_info_t **
> > +{
> > + PyObject *list;
> > + PyObject *rev, *date, *author;
> > + if (!(*$1)) {
> > + return Py_None;
>
> Shouldn't that be $result = Py_None?

Heh. Yep. This code originally lived in swigutil.c, and I missed
that in the cut-n-paste.

> And this must be INCREF'd.

Gotcha.

> > + list = PyList_New(3);
> > + rev = PyInt_FromLong((*$1)->revision);
> > + date = PyString_FromString((*$1)->date);
> > + author = PyString_FromString((*$1)->author);
> > + if (!(list && rev && date && author)) {
> > + Py_XDECREF(rev);
> > + Py_XDECREF(date);
> > + Py_XDECREF(author);
> > + Py_DECREF(list);
>
> list could be NULL also, so this should be an XDECREF.

Cha-ching -- that registers ;-)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 31 16:12:21 2002

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.