From cb61d8a89c70c1771947c10984eeab2141133bd4 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 9 Mar 2011 16:08:59 +0200 Subject: Python 3 fixups - PyString is gone, use PyBytes instead - Add compatibility defines to paper over PyInt/PyLong_JustHowLongFunctionNamesYouCanComeUpWith() --- python/rpmii-py.c | 2 +- python/rpmsystem-py.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/rpmii-py.c b/python/rpmii-py.c index ae74c94e7..51d74e824 100644 --- a/python/rpmii-py.c +++ b/python/rpmii-py.c @@ -47,7 +47,7 @@ rpmii_iternext(rpmiiObject * s) s->ii = rpmdbIndexIteratorFree(s->ii); return NULL; } - return PyString_FromStringAndSize(key, keylen); + return PyBytes_FromStringAndSize(key, keylen); }; static PyObject * diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h index 3d88b3dbe..eb42dd33f 100644 --- a/python/rpmsystem-py.h +++ b/python/rpmsystem-py.h @@ -36,6 +36,8 @@ typedef Py_ssize_t (*lenfunc)(PyObject *); #define PyInt_Check PyLong_Check #define PyInt_AsLong PyLong_AsLong #define PyInt_FromLong PyLong_FromLong +#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask +#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #endif #endif /* H_SYSTEM_PYTHON */ -- cgit v1.2.3