From 2463550650b1319a9e895c7bf532f64258e577c5 Mon Sep 17 00:00:00 2001
From: Stefan Behnel <scoder@users.berlios.de>
Date: Wed, 28 May 2008 11:11:24 +0200
Subject: [PATCH] Py3.0beta compatibility fixes

---
 Cython/Compiler/ExprNodes.py  | 1 +
 Cython/Compiler/ModuleNode.py | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 406da371d..9c0bcee01 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 99065b613..80e739536 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)")
-- 
2.30.9