revert C++ assignment fix as it breaks gcc
authorStefan Behnel <scoder@users.berlios.de>
Thu, 17 Jan 2008 22:09:13 +0000 (23:09 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 17 Jan 2008 22:09:13 +0000 (23:09 +0100)
Cython/Compiler/ModuleNode.py

index 207b02154f5bcf3fe7e6186be33d5127f861e0fe..55bbbda63ce8af422117113f8d290e4ca0602c3c 100644 (file)
@@ -797,10 +797,8 @@ 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, PyrexTypes.py_object_type)
+            code.putln("tmp = ((PyObject*)%s);" % name)
+            code.put_init_to_py_none(name, entry.type)
             code.putln("Py_XDECREF(tmp);")
         code.putln(
             "return 0;")