From 3a9b521505e08c6990abf80e4743939a09ea61d8 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 17 Jan 2008 06:30:44 -0800 Subject: [PATCH] C++ assignment fix --- Cython/Compiler/ModuleNode.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;") -- 2.26.2