self.parent_module = parent_module
outer_scope = context.find_submodule("__builtin__")
Scope.__init__(self, name, outer_scope, parent_module)
- self.module_name = name
+ if name != "__init__":
+ self.module_name = name
+ else:
+ # Treat Spam/__init__.pyx specially, so that when Python loads
+ # Spam/__init__.so, initSpam() is defined.
+ self.module_name = parent_module.module_name
self.context = context
self.module_cname = Naming.module_cname
self.module_dict_cname = Naming.moddict_cname