Py3.0beta compatibility fixes
authorStefan Behnel <scoder@users.berlios.de>
Wed, 28 May 2008 09:11:24 +0000 (11:11 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 28 May 2008 09:11:24 +0000 (11:11 +0200)
Cython/Compiler/ExprNodes.py
Cython/Compiler/ModuleNode.py

index 406da371d1756c6dd43a1ca6d638a8b09abdfda7..9c0bcee010201aacfbbf42874bfb002a6dedfe0d 100644 (file)
@@ -4107,6 +4107,7 @@ static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
 type_cache_invalidation_code = [
 """
 #if PY_VERSION_HEX >= 0x02060000
+/* #define __Pyx_TypeModified(t) PyType_Modified(t) */  /* Py3.0beta1 */
 static void __Pyx_TypeModified(PyTypeObject* type); /*proto*/
 #else
   #define __Pyx_TypeModified(t)
index 99065b6132484dc54bc8c831836b648177a50770..80e7395367874cf705f12f0f2f2b14b00b93c5ef 100644 (file)
@@ -422,6 +422,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
         code.putln("#endif")
 
         code.putln("#if PY_MAJOR_VERSION >= 3")
+        code.putln("  #include \"stringobject.h\"") # Py3 compat header for PyString_*()
         code.putln("  #define PyBaseString_Type            PyUnicode_Type")
         code.putln("  #define PyInt_Type                   PyLong_Type")
         code.putln("  #define PyInt_Check(op)              PyLong_Check(op)")