summaryrefslogtreecommitdiff
path: root/searx/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'searx/plugins')
-rw-r--r--searx/plugins/calculator.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/plugins/calculator.py b/searx/plugins/calculator.py
index ba9dc8721..af44eea1e 100644
--- a/searx/plugins/calculator.py
+++ b/searx/plugins/calculator.py
@@ -170,8 +170,8 @@ def _eval_expr(expr):
root_expr = ast.parse(expr, mode='eval').body
return _eval(root_expr), isinstance(root_expr, ast.Compare)
- except ZeroDivisionError:
- # This is undefined
+ except (SyntaxError, TypeError, ZeroDivisionError):
+ # Expression that can't be evaluated (i.e. not a math expression)
return "", False