#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"
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);