summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-23 11:10:38 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-23 11:10:38 +0300
commitb997746271d764bebc86f207871e5e0e57e7b720 (patch)
tree106caa3215d60f8e125a93e689edc14225552d90
parent79e87e5ea16ed7118536b12e267d93db74e15265 (diff)
downloadlibrpm-tizen-b997746271d764bebc86f207871e5e0e57e7b720.tar.gz
librpm-tizen-b997746271d764bebc86f207871e5e0e57e7b720.tar.bz2
librpm-tizen-b997746271d764bebc86f207871e5e0e57e7b720.zip
Accept any file object in ts.hdrFromFdno()
-rw-r--r--python/rpmts-py.c8
1 files 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);