From b41bba2c1696a073e03b5e8db8947a860dfd8fdd Mon Sep 17 00:00:00 2001 From: pauln Date: Thu, 10 Jun 2004 14:48:46 +0000 Subject: [PATCH] Return a single ds if you try and iterate over a single ds CVS patchset: 7301 CVS date: 2004/06/10 14:48:46 --- python/rpmds-py.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) 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; -- 2.7.4