From: Robert Bradshaw Date: Thu, 17 Jan 2008 14:30:44 +0000 (-0800) Subject: C++ assignment fix X-Git-Tag: 0.9.6.14~29^2~66 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3a9b521505e08c6990abf80e4743939a09ea61d8;p=cython.git C++ assignment fix --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 83328286..ccb4f7e6 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -799,8 +799,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("}") for entry in py_attrs: name = "p->%s" % entry.cname + if entry.type.is_extension_type: + name = "((PyObject*)%s)" % name code.putln("tmp = %s;" % name) - code.put_init_to_py_none(name, entry.type) + code.put_init_to_py_none(name, PyrexTypes.py_object_type) code.putln("Py_XDECREF(tmp);") code.putln( "return 0;")