From 4047397da1875b1e5b561e039ad6cd7d99206aa1 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 21 Oct 2009 13:21:01 +0300 Subject: [PATCH] On Python 3, use macros to alias all usage of PyInt_ to PyLong_ equivalents - Python 3 unified PyInt with PyLong, the former no longer exists - Based on a patch by David Malcolm --- python/rpmsystem-py.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h index d4923ab..b27a410 100644 --- a/python/rpmsystem-py.h +++ b/python/rpmsystem-py.h @@ -33,4 +33,11 @@ typedef Py_ssize_t (*lenfunc)(PyObject *); #define PyXBytes_AsString PyString_AsString #endif +/* For Python 3, use the PyLong type throughout in place of PyInt */ +#if PY_MAJOR_VERSION >= 3 +#define PyInt_Check PyLong_Check +#define PyInt_AsLong PyLong_AsLong +#define PyInt_FromLong PyLong_FromLong +#endif + #endif /* H_SYSTEM_PYTHON */ -- 2.7.4