Commit 31a9be95 authored by gsamain's avatar gsamain

Fix default __alloc__ comment always triggering

parent 643e267e
...@@ -1044,9 +1044,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1044,9 +1044,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if type.is_cyp_class: if type.is_cyp_class:
code.putln("// Auto generating default constructor to have Python-like behaviour") code.putln("// Auto generating default constructor to have Python-like behaviour")
code.putln("%s(){}" % type.cname) code.putln("%s(){}" % type.cname)
code.putln("// Generating __alloc__ function (used for __new__ calls)")
alloc_entry = scope.lookup_here("<alloc>") alloc_entry = scope.lookup_here("<alloc>")
if alloc_entry.is_builtin_cmethod: if alloc_entry.is_builtin_cmethod:
code.putln("// Generating default __alloc__ function (used for __new__ calls)")
code.putln("static %s { return new %s(); }" % (alloc_entry.type.declaration_code(alloc_entry.cname), type.declaration_code("", deref=1))) code.putln("static %s { return new %s(); }" % (alloc_entry.type.declaration_code(alloc_entry.cname), type.declaration_code("", deref=1)))
code.putln("};") code.putln("};")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment