From c21a1ea23db40bd136a859eb171a49ae51e25c64 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 23 Sep 2009 10:11:45 +0300 Subject: [PATCH] Deprecate rpm.headerLoad() - this is not needed now, just call rpm.hdr(h; } -PyObject * hdrLoad(PyObject * self, PyObject * args, PyObject * kwds) +PyObject * hdrLoad(PyObject * s, PyObject * args, PyObject * kwds) { - PyObject * hdr; - char * obj; - Header h; - int len; - char * kwlist[] = {"headers", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#", kwlist, &obj, &len)) - return NULL; - - /* copy is needed to avoid surprises from data swab in headerLoad(). */ - h = headerCopyLoad(obj); - if (!h) { - PyErr_SetString(pyrpmError, "bad header"); - return NULL; - } - headerConvert(h, HEADERCONV_RETROFIT_V3); - - hdr = hdr_Wrap(h); - h = headerFree(h); /* XXX ref held by hdr */ - - return hdr; + DEPRECATED_METHOD; + return PyObject_Call((PyObject *) &hdr_Type, args, kwds); } PyObject * rpmReadHeaders (FD_t fd) -- 2.7.4