From 4bb2ef8ea23e160cbd79c8e70c9e5467c462aecc Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 26 Mar 2010 14:07:54 -0300 Subject: [PATCH] compatibility fix for Python 2.4 --- Cython/Compiler/ModuleNode.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 72229376..56fb98b7 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -2180,7 +2180,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + PyErr_Warn(NULL, warning); + #else PyErr_WarnEx(NULL, warning, 0); + #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, -- 2.26.2