From: Panu Matilainen Date: Tue, 22 Sep 2009 16:42:53 +0000 (+0300) Subject: Simplify dsFromHeader() X-Git-Tag: rpm-4.8.0-beta1~227 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=708d4d8f1bd215d1dffce3f8d5680d2c967145b8;p=platform%2Fupstream%2Frpm.git Simplify dsFromHeader() - just call the ds object, no need to manually redo all this stuff --- diff --git a/python/rpmds-py.c b/python/rpmds-py.c index 125b3d2..a9df231 100644 --- a/python/rpmds-py.c +++ b/python/rpmds-py.c @@ -610,21 +610,8 @@ rpmds_Single(PyObject * s, PyObject * args, PyObject * kwds) rpmdsObject * hdr_dsFromHeader(PyObject * s, PyObject * args, PyObject * kwds) { - hdrObject * ho = (hdrObject *)s; - PyObject * to = NULL; - rpmTag tagN = RPMTAG_REQUIRENAME; - rpmsenseFlags flags = 0; - char * kwlist[] = {"to", "flags", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:dsFromHeader", kwlist, - &to, &flags)) - return NULL; - - if (to != NULL) { - tagN = tagNumFromPyObject(to); - if (tagN == RPMTAG_NOT_FOUND) return NULL; - } - return rpmds_Wrap( rpmdsNew(hdrGetHeader(ho), tagN, 0) ); + return PyObject_Call((PyObject *) &rpmds_Type, + Py_BuildValue("(O)", s), kwds); } rpmdsObject *