C++ assignment fix
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 17 Jan 2008 14:30:44 +0000 (06:30 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 17 Jan 2008 14:30:44 +0000 (06:30 -0800)
Cython/Compiler/ModuleNode.py

index 8332828684263b6122af9c5376337c63a4ddfd85..ccb4f7e6b40e3dbfa7845a32f88141ef1d9fcbd1 100644 (file)
@@ -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;")