From 65a6afbbdaf1fc81304c66ffb1b024d63c4bbb5a Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 28 Sep 2009 13:30:28 +0300 Subject: Arrange rpm.headerLoad() compatibility on python level --- python/header-py.c | 6 ------ python/rpm/__init__.py | 4 ++++ python/rpmmodule.c | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'python') diff --git a/python/header-py.c b/python/header-py.c index 0f940afa1..521f5b6b7 100644 --- a/python/header-py.c +++ b/python/header-py.c @@ -524,12 +524,6 @@ Header hdrGetHeader(hdrObject * s) return s->h; } -PyObject * hdrLoad(PyObject * s, PyObject * args, PyObject * kwds) -{ - DEPRECATED_METHOD; - return PyObject_Call((PyObject *) &hdr_Type, args, kwds); -} - PyObject * rpmReadHeaders (FD_t fd) { PyObject * list; diff --git a/python/rpm/__init__.py b/python/rpm/__init__.py index 8354bc874..e70602574 100644 --- a/python/rpm/__init__.py +++ b/python/rpm/__init__.py @@ -4,6 +4,7 @@ This module enables you to manipulate rpms and the rpm database. """ +import warnings from _rpm import * import _rpm @@ -12,3 +13,6 @@ _RPMVSF_NOHEADER = _rpm._RPMVSF_NOHEADER _RPMVSF_NOPAYLOAD = _rpm._RPMVSF_NOPAYLOAD _RPMVSF_NOSIGNATURES = _rpm._RPMVSF_NOSIGNATURES +def headerLoad(*args, **kwds): + warnings.warn("Use rpm.hdr() instead.", DeprecationWarning, stacklevel=2) + return hdr(*args, **kwds) diff --git a/python/rpmmodule.c b/python/rpmmodule.c index d43e89cc7..ff516fc5b 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -158,8 +158,6 @@ static PyMethodDef rpmModuleMethods[] = { { "checkSignals", (PyCFunction) checkSignals, METH_VARARGS, NULL }, - { "headerLoad", (PyCFunction) hdrLoad, METH_VARARGS|METH_KEYWORDS, - NULL }, { "mergeHeaderListFromFD", (PyCFunction) rpmMergeHeadersFromFD, METH_VARARGS|METH_KEYWORDS, NULL }, { "readHeaderListFromFD", (PyCFunction) rpmHeaderFromFD, METH_VARARGS|METH_KEYWORDS, -- cgit v1.2.3