From 75b241ff2090c719c0113ba617a5defa37755c9a Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 11 Nov 2008 01:29:42 -0800 Subject: [PATCH] Add __file__, __doc__, __name__, __builtins__ to module globals. --- Cython/Compiler/Symtab.py | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.26.2