Commit a21f7511 authored by Boxiang Sun's avatar Boxiang Sun

use Python builtin compile function

The last variable in the return list is the code.names field.
After some experiments, seems return an empty value has no side
effects, at least for now. Let's see....
parent 2ebcf9c5
......@@ -99,8 +99,9 @@ def compile_restricted_exec(s, filename='<string>'):
def compile_restricted_eval(s, filename='<string>'):
"""Compiles a restricted expression."""
gen = RExpression(s, filename)
return compileAndTuplize(gen)
# gen = RExpression(s, filename)
# return compileAndTuplize(gen)
return compile(s, filename, 'eval'), (), [], {}
def compile_restricted(source, filename, mode):
"""Replacement for the builtin compile() function."""
......
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