On Python 3, use macros to alias all usage of PyInt_ to PyLong_ equivalents
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 21 Oct 2009 10:21:01 +0000 (13:21 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 21 Oct 2009 10:21:01 +0000 (13:21 +0300)
- Python 3 unified PyInt with PyLong, the former no longer exists
- Based on a patch by David Malcolm

python/rpmsystem-py.h

index d4923ab..b27a410 100644 (file)
@@ -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 */