diff --git a/asteval/asteval.py b/asteval/asteval.py index 091b5cf..69f0d11 100644 --- a/asteval/asteval.py +++ b/asteval/asteval.py @@ -68,6 +68,7 @@ MINIMAL_CONFIG[_tnode] = False DEFAULT_CONFIG[_tnode] = True + class Interpreter: """create an asteval Interpreter: a restricted, simplified interpreter of mathematical expressions using Python syntax. @@ -295,9 +296,8 @@ def run(self, node, expr=None, lineno=None, with_raise=True): return ret except: if with_raise: - if len(self.error) == 0: - # Unhandled exception that didn't use raise_exception - self.raise_exception(node, expr=expr) + # Unhandled exception that didn't use raise_exception + self.raise_exception(node, expr=expr) raise return None