Commit 634324ff authored by Stefan Behnel's avatar Stefan Behnel

Only inject eval() locals/globals args when it's called as a builtin and not...

Only inject eval() locals/globals args when it's called as a builtin and not redefined e.g. in the module (found when updating test_grammar() and overriding it there).
parent 49103e45
......@@ -3096,8 +3096,8 @@ class TransformBuiltinMethods(EnvTransform):
def _inject_eval(self, node, func_name):
lenv = self.current_env()
entry = lenv.lookup_here(func_name)
if entry or len(node.args) != 1:
entry = lenv.lookup(func_name)
if len(node.args) != 1 or (entry and not entry.is_builtin):
return node
# Inject globals and locals
node.args.append(ExprNodes.GlobalsExprNode(node.pos))
......
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