diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-09-22 19:42:53 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-09-22 19:42:53 +0300 |
commit | 708d4d8f1bd215d1dffce3f8d5680d2c967145b8 (patch) | |
tree | eed8a51877c108e3d21c1edca479fbdc200646a0 /python | |
parent | da74188fa654246ec74e0375440f326e5dc714f2 (diff) | |
download | rpm-708d4d8f1bd215d1dffce3f8d5680d2c967145b8.tar.gz rpm-708d4d8f1bd215d1dffce3f8d5680d2c967145b8.tar.bz2 rpm-708d4d8f1bd215d1dffce3f8d5680d2c967145b8.zip |
Simplify dsFromHeader()
- just call the ds object, no need to manually redo all this stuff
Diffstat (limited to 'python')
-rw-r--r-- | python/rpmds-py.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/python/rpmds-py.c b/python/rpmds-py.c index 125b3d252..a9df23143 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 * |