From: Robert Bradshaw Date: Tue, 11 Nov 2008 09:29:42 +0000 (-0800) Subject: Add __file__, __doc__, __name__, __builtins__ to module globals. X-Git-Tag: 0.11-beta~270 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=75b241ff2090c719c0113ba617a5defa37755c9a;p=cython.git Add __file__, __doc__, __name__, __builtins__ to module globals. --- diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index c6a697af..8c7752ef 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -821,6 +821,8 @@ class ModuleScope(Scope): self.cached_builtins = [] self.undeclared_cached_builtins = [] self.namespace_cname = self.module_cname + for name in ['__builtins__', '__name__', '__file__', '__doc__']: + self.declare_var(EncodedString(name), py_object_type, None) def qualifying_scope(self): return self.parent_module