cython-devel

changeset 1524:3569aa5167f1

Set module name for Spam/__init__.pyx to Spam.
author Jason Evans <jasone@canonware.com>
date Fri Dec 19 16:50:47 2008 -0800 (3 years ago)
parents 965dc9fc3da7
children c7d5e9f8e0ec
files Cython/Compiler/Symtab.py
line diff
1.1 --- a/Cython/Compiler/Symtab.py Fri Dec 19 21:57:32 2008 +0100 1.2 +++ b/Cython/Compiler/Symtab.py Fri Dec 19 16:50:47 2008 -0800 1.3 @@ -805,7 +805,12 @@ 1.4 self.parent_module = parent_module 1.5 outer_scope = context.find_submodule("__builtin__") 1.6 Scope.__init__(self, name, outer_scope, parent_module) 1.7 - self.module_name = name 1.8 + if name != "__init__": 1.9 + self.module_name = name 1.10 + else: 1.11 + # Treat Spam/__init__.pyx specially, so that when Python loads 1.12 + # Spam/__init__.so, initSpam() is defined. 1.13 + self.module_name = parent_module.module_name 1.14 self.context = context 1.15 self.module_cname = Naming.module_cname 1.16 self.module_dict_cname = Naming.moddict_cname