Commit 38ceddfd authored by Stefan Behnel's avatar Stefan Behnel

fix bug 429: make 'locals' builtin overridable

parent 50b15073
......@@ -978,8 +978,12 @@ class TransformBuiltinMethods(EnvTransform):
# locals builtin
if isinstance(node.function, ExprNodes.NameNode):
if node.function.name == 'locals':
pos = node.pos
lenv = self.env_stack[-1]
entry = lenv.lookup_here('locals')
if entry:
# not the builtin 'locals'
return node
pos = node.pos
items = [ExprNodes.DictItemNode(pos,
key=ExprNodes.StringNode(pos, value=var),
value=ExprNodes.NameNode(pos, name=var)) for var in lenv.entries]
......
......@@ -8,5 +8,4 @@ unsignedbehaviour_T184
bad_c_struct_T252
missing_baseclass_in_predecl_T262
extended_unpacking_T409
locals_rebind_T429
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