Commit 928f6afb authored by gsamain's avatar gsamain Committed by Xavier Thompson

Fix default __alloc__ comment always triggering

parent 351453d0
......@@ -1118,9 +1118,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if type.is_cyp_class:
code.putln("// Auto generating default constructor to have Python-like behaviour")
code.putln("%s(){}" % type.cname)
code.putln("// Generating __alloc__ function (used for __new__ calls)")
alloc_entry = scope.lookup_here("<alloc>")
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("};")
......
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