reset to None instead of NULL in tp_clear()
authorStefan Behnel <scoder@users.berlios.de>
Sun, 13 Jan 2008 09:11:07 +0000 (10:11 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 13 Jan 2008 09:11:07 +0000 (10:11 +0100)
Cython/Compiler/ModuleNode.py

index 5b918dabeeaf13b6d6eedc00141584568b23b5eb..fe9a1d0affb060662d6435aa83d7d4e627a813cf 100644 (file)
@@ -767,7 +767,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
             code.putln("}")
         for entry in py_attrs:
             name = "p->%s" % entry.cname
-            code.putln("tmp = %s; %s = 0;" % (name, name))
+            code.putln("tmp = %s;" % name)
+            code.put_init_to_py_none(name, entry.type)
             code.putln("Py_XDECREF(tmp);")
         code.putln(
             "return 0;")