From 799c6e782be5e11186ec853b35f5b7eeb7db7463 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 18 Nov 2010 21:47:33 +0100 Subject: [PATCH] Py3 fix --- Cython/Compiler/ExprNodes.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.26.2