From: Stefan Behnel Date: Thu, 18 Nov 2010 20:47:33 +0000 (+0100) Subject: Py3 fix X-Git-Tag: 0.14.alpha0~120 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=799c6e782be5e11186ec853b35f5b7eeb7db7463;p=cython.git Py3 fix --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 9e4e4118..d87ad1b0 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -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;