Py3 fix
authorStefan Behnel <scoder@users.berlios.de>
Thu, 18 Nov 2010 20:47:33 +0000 (21:47 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 18 Nov 2010 20:47:33 +0000 (21:47 +0100)
Cython/Compiler/ExprNodes.py

index 9e4e4118d4b1805f05de14fd12ba5ddfaa898522..d87ad1b0bfb515dc7d403c0e8ea61c3011a0cb91 100755 (executable)
@@ -7565,7 +7565,11 @@ PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObje
 
     /* Required here to emulate assignment order */
     /* XXX: use consts here */
+    #if PY_MAJOR_VERSION >= 3
+    str = PyUnicode_FromString("__module__");
+    #else
     str = PyString_FromString("__module__");
+    #endif
     if (!str) {
         Py_DECREF(ns);
         return NULL;
@@ -7578,7 +7582,11 @@ PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObje
     }
     Py_DECREF(str);
     if (doc) {
+        #if PY_MAJOR_VERSION >= 3
+        str = PyUnicode_FromString("__doc__");
+        #else
         str = PyString_FromString("__doc__");
+        #endif
         if (!str) {
             Py_DECREF(ns);
             return NULL;