From: Stefan Behnel Date: Wed, 21 Oct 2009 19:44:42 +0000 (+0200) Subject: fix bug 430: make 'locals().items()' work X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=029da6428fcd57f59fe5bb4c0726f7623eb06d57;p=cython.git fix bug 430: make 'locals().items()' work --- diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index c760f4d1..93bf4bc2 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -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), diff --git a/tests/bugs.txt b/tests/bugs.txt index fed33556..58205179 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -8,4 +8,3 @@ unsignedbehaviour_T184 bad_c_struct_T252 missing_baseclass_in_predecl_T262 extended_unpacking_T409 -locals_expressions_T430