mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-26 04:32:51 +01:00
safeEval: Get rid of eval().
It should be safe considering the AST sanity checks, but I don't see any point in keeping it.
This commit is contained in:
parent
6f4e3a2dbd
commit
3d1e88cb68
@ -202,9 +202,6 @@ def safeEval(s, namespace=None):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
if checkNode(node):
|
if checkNode(node):
|
||||||
if namespace is None:
|
|
||||||
return eval(s, namespace, namespace)
|
|
||||||
else:
|
|
||||||
# Probably equivalent to eval() because checkNode(node) is True,
|
# Probably equivalent to eval() because checkNode(node) is True,
|
||||||
# but it's an extra security.
|
# but it's an extra security.
|
||||||
return ast.literal_eval(node)
|
return ast.literal_eval(node)
|
||||||
|
Loading…
Reference in New Issue
Block a user