Commit 029da642 authored by Stefan Behnel's avatar Stefan Behnel

fix bug 430: make 'locals().items()' work

parent 9abadbd6
...@@ -957,6 +957,7 @@ class TransformBuiltinMethods(EnvTransform): ...@@ -957,6 +957,7 @@ class TransformBuiltinMethods(EnvTransform):
return node return node
def visit_AttributeNode(self, node): def visit_AttributeNode(self, node):
self.visitchildren(node)
return self.visit_cython_attribute(node) return self.visit_cython_attribute(node)
def visit_NameNode(self, node): def visit_NameNode(self, node):
...@@ -983,6 +984,9 @@ class TransformBuiltinMethods(EnvTransform): ...@@ -983,6 +984,9 @@ class TransformBuiltinMethods(EnvTransform):
if entry: if entry:
# not the builtin 'locals' # not the builtin 'locals'
return node 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 pos = node.pos
items = [ExprNodes.DictItemNode(pos, items = [ExprNodes.DictItemNode(pos,
key=ExprNodes.StringNode(pos, value=var), key=ExprNodes.StringNode(pos, value=var),
......
...@@ -8,4 +8,3 @@ unsignedbehaviour_T184 ...@@ -8,4 +8,3 @@ unsignedbehaviour_T184
bad_c_struct_T252 bad_c_struct_T252
missing_baseclass_in_predecl_T262 missing_baseclass_in_predecl_T262
extended_unpacking_T409 extended_unpacking_T409
locals_expressions_T430
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment