fix bug 430: make 'locals().items()' work
authorStefan Behnel <scoder@users.berlios.de>
Wed, 21 Oct 2009 19:44:42 +0000 (21:44 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 21 Oct 2009 19:44:42 +0000 (21:44 +0200)
Cython/Compiler/ParseTreeTransforms.py
tests/bugs.txt

index c760f4d14d9f2eda31b260a5e692cb70895071dd..93bf4bc20bda847f44c476b4f74a19b4ae553c7e 100644 (file)
@@ -957,6 +957,7 @@ class TransformBuiltinMethods(EnvTransform):
             return node
     
     def visit_AttributeNode(self, node):
+        self.visitchildren(node)
         return self.visit_cython_attribute(node)
 
     def visit_NameNode(self, node):
@@ -983,6 +984,9 @@ class TransformBuiltinMethods(EnvTransform):
                 if entry:
                     # not the builtin 'locals'
                     return node
+                if len(node.args) > 0:
+                    error(self.pos, "Builtin 'locals()' called with wrong number of args, expected 0, got %d" % len(node.args))
+                    return node
                 pos = node.pos
                 items = [ExprNodes.DictItemNode(pos, 
                                                 key=ExprNodes.StringNode(pos, value=var),
index fed33556d1b7bfa07605b59179464b0f68a14c1e..58205179cf7cbec06a98104c191a51931362fc09 100644 (file)
@@ -8,4 +8,3 @@ unsignedbehaviour_T184
 bad_c_struct_T252
 missing_baseclass_in_predecl_T262
 extended_unpacking_T409
-locals_expressions_T430