compatibility fix for Python 2.4
authorLisandro Dalcin <dalcinl@gmail.com>
Fri, 26 Mar 2010 17:07:54 +0000 (14:07 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Fri, 26 Mar 2010 17:07:54 +0000 (14:07 -0300)
Cython/Compiler/ModuleNode.py

index 722293760b4737b26085271dc531d0e871f96b3e..56fb98b7fbc7b93d7cf0e0bc5cc801326eca5105 100644 (file)
@@ -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,