From 388eafbf7d1d105385704b3f84ae76e15d8e788c Mon Sep 17 00:00:00 2001 From: pyldap contributors Date: Fri, 24 Nov 2017 10:46:12 +0100 Subject: [PATCH] Modules: Python 3, alias PyInt to PyLong --- Modules/common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modules/common.h b/Modules/common.h index 1ec232c..0eea1d9 100644 --- a/Modules/common.h +++ b/Modules/common.h @@ -27,5 +27,11 @@ void LDAPadd_methods( PyObject*d, PyMethodDef*methods ); #define PyNone_Check(o) ((o) == Py_None) +/* Py2/3 compatibility */ +#if PY_VERSION_HEX >= 0x03000000 +/* In Python 3, alias PyInt to PyLong */ +#define PyInt_FromLong PyLong_FromLong +#endif + #endif /* __h_common_ */