Commit 23ef44c7 authored by Stefan Behnel's avatar Stefan Behnel

avoid generating empty PyMethodDef array for types (especially closures)

parent ace2e6f9
......@@ -1820,6 +1820,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
"};")
def generate_method_table(self, env, code):
if env.is_c_class_scope and not env.pyfunc_entries:
return
code.putln("")
code.putln(
"static PyMethodDef %s[] = {" %
......
......@@ -460,7 +460,10 @@ class MethodTableSlot(SlotDescriptor):
# Slot descriptor for the method table.
def slot_code(self, scope):
return scope.method_table_cname
if scope.pyfunc_entries:
return scope.method_table_cname
else:
return "0"
class MemberTableSlot(SlotDescriptor):
......
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