Commit 5434ed97 by James Cammarata

Make sure locals in safe_eval is a plain dict when running eval

Fixes #12206
parent 9ecfc30f
......@@ -107,7 +107,7 @@ def safe_eval(expr, locals={}, include_exceptions=False):
parsed_tree = ast.parse(expr, mode='eval')
cnv.visit(parsed_tree)
compiled = compile(parsed_tree, expr, 'eval')
result = eval(compiled, {}, locals)
result = eval(compiled, {}, dict(locals))
if include_exceptions:
return (result, None)
......
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