'Serialize the module-level code as a function so the debugger will know
it\'s a "relevant frame" and it will know where to set the breakpoint
for \'break modulename\'.'

def serialize_modulenode_as_function(self, node):

    name = node.full_module_name.rpartition('.')[(-1)]
    cname_py2 = ('init' + name)
    cname_py3 = ('PyInit_' + name)
    py2_attrs = dict(name=name, cname=cname_py2, pf_cname='', qualified_name='', lineno='1', is_initmodule_function='True')
    py3_attrs = dict(py2_attrs, cname=cname_py3)
    self._serialize_modulenode_as_function(node, py2_attrs)
    self._serialize_modulenode_as_function(node, py3_attrs)
