|
@ -12,9 +12,6 @@ from .data_error import DataError |
|
|
__all__ = ['mis_safe_eval'] |
|
|
__all__ = ['mis_safe_eval'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std_eval = eval |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def mis_safe_eval(expr, locals_dict): |
|
|
def mis_safe_eval(expr, locals_dict): |
|
|
""" Evaluate an expression using safe_eval |
|
|
""" Evaluate an expression using safe_eval |
|
|
|
|
|
|
|
@ -26,7 +23,7 @@ def mis_safe_eval(expr, locals_dict): |
|
|
try: |
|
|
try: |
|
|
c = test_expr(expr, _SAFE_OPCODES, mode='eval') |
|
|
c = test_expr(expr, _SAFE_OPCODES, mode='eval') |
|
|
globals_dict = {'__builtins__': _BUILTINS} |
|
|
globals_dict = {'__builtins__': _BUILTINS} |
|
|
val = std_eval(c, globals_dict, locals_dict) # noqa |
|
|
|
|
|
|
|
|
val = eval(c, globals_dict, locals_dict) # pylint: disable=eval-used |
|
|
except NameError: |
|
|
except NameError: |
|
|
raise |
|
|
raise |
|
|
except ZeroDivisionError: |
|
|
except ZeroDivisionError: |
|
|