From: Stefan Behnel Date: Wed, 28 May 2008 09:11:24 +0000 (+0200) Subject: Py3.0beta compatibility fixes X-Git-Tag: 0.9.8rc1~11^2~10^2~10^2~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2463550650b1319a9e895c7bf532f64258e577c5;p=cython.git Py3.0beta compatibility fixes --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 406da371..9c0bcee0 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -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) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 99065b61..80e73953 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -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)")