Add __file__, __doc__, __name__, __builtins__ to module globals.
authorRobert Bradshaw <robertwb@math.washington.edu>
Tue, 11 Nov 2008 09:29:42 +0000 (01:29 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Tue, 11 Nov 2008 09:29:42 +0000 (01:29 -0800)
Cython/Compiler/Symtab.py

index c6a697af4bded76e0c51edba6a2a8fa0b4bab2a6..8c7752efa0bd4b3798c1da762113d1b29aa37d50 100644 (file)
@@ -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