From: pauln Date: Thu, 10 Jun 2004 14:48:46 +0000 (+0000) Subject: Return a single ds if you try and iterate over a single ds X-Git-Tag: rpm-4.4-release~234 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b41bba2c1696a073e03b5e8db8947a860dfd8fdd;p=platform%2Fupstream%2Frpm.git Return a single ds if you try and iterate over a single ds CVS patchset: 7301 CVS date: 2004/06/10 14:48:46 --- diff --git a/python/rpmds-py.c b/python/rpmds-py.c index c4145c3..d02f83b 100644 --- a/python/rpmds-py.c +++ b/python/rpmds-py.c @@ -254,20 +254,10 @@ rpmds_iternext(rpmdsObject * s) if (rpmdsNext(s->ds) >= 0) { const char * N = rpmdsN(s->ds); const char * EVR = rpmdsEVR(s->ds); + int tagN = rpmdsTagN(s->ds); int Flags = rpmdsFlags(s->ds); - result = PyTuple_New(3); - PyTuple_SET_ITEM(result, 0, Py_BuildValue("s", N)); - if (EVR == NULL) { - Py_INCREF(Py_None); - PyTuple_SET_ITEM(result, 1, Py_None); - Py_INCREF(Py_None); - PyTuple_SET_ITEM(result, 2, Py_None); - } else { - PyTuple_SET_ITEM(result, 1, Py_BuildValue("s", EVR)); - PyTuple_SET_ITEM(result, 2, PyInt_FromLong(Flags)); - } - + result = rpmds_Wrap( rpmdsSingle(tagN, N, EVR, Flags) ); } else s->active = 0;