mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-01 18:28:27 +02:00
security: safe_eval can only execute code from python 3.10
This commit is contained in:
parent
422c1de267
commit
7c746de01c
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ def safe_eval(template: "TemplateSafeEval", env: "Env" = None, macros: dict[str,
|
|||
locals_ = {}
|
||||
|
||||
# convert the template to an ast expression
|
||||
stmt: ast.stmt = ast.parse(template).body[0]
|
||||
stmt: ast.stmt = ast.parse(template, feature_version=(3, 10)).body[0]
|
||||
if not isinstance(stmt, ast.Expr):
|
||||
raise SafeEvalException(_("ERROR_INVALID_AST_TYPE") % type(stmt).__name__)
|
||||
|
||||
|
|
Loading…
Reference in a new issue