From b997746271d764bebc86f207871e5e0e57e7b720 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 23 Sep 2009 11:10:38 +0300 Subject: Accept any file object in ts.hdrFromFdno() --- python/rpmts-py.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/rpmts-py.c b/python/rpmts-py.c index 6d858ac24..7824ba884 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -8,6 +8,7 @@ #include "header-py.h" #include "rpmds-py.h" /* XXX for rpmdsNew */ +#include "rpmfd-py.h" #include "rpmfi-py.h" /* XXX for rpmfiNew */ #include "rpmmi-py.h" #include "rpmps-py.h" @@ -454,17 +455,16 @@ static PyObject * rpmts_HdrFromFdno(rpmtsObject * s, PyObject * args, PyObject * kwds) { PyObject * result = NULL; + PyObject * fo = NULL; Header h; FD_t fd; - int fdno; rpmRC rpmrc; char * kwlist[] = {"fd", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "i:HdrFromFdno", kwlist, - &fdno)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:HdrFromFdno", kwlist, &fo)) return NULL; - fd = fdDup(fdno); + if ((fd = rpmFdFromPyObject(fo)) == NULL) return NULL; rpmrc = rpmReadPackageFile(s->ts, fd, "rpmts_HdrFromFdno", &h); Fclose(fd); -- cgit v1.2.3