def load_file(filename, env):
from utils import e
filename = e(filename)
g = GlobalsWrapper(env, filename)
with open(filename, 'r') as f:
tree = ast.parse(f.read(), filename)
t2 = ast.fix_missing_locations(AstTransformer().visit(tree))
exec(compile(t2, filename, 'exec'), g)
return g.dict
评论列表
文章目录