summaryrefslogtreecommitdiff
path: root/searx/answerers/statistics
diff options
context:
space:
mode:
Diffstat (limited to 'searx/answerers/statistics')
-rw-r--r--searx/answerers/statistics/answerer.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/searx/answerers/statistics/answerer.py b/searx/answerers/statistics/answerer.py
index 73dd25cfd..abd4be7f5 100644
--- a/searx/answerers/statistics/answerer.py
+++ b/searx/answerers/statistics/answerer.py
@@ -1,11 +1,8 @@
-from sys import version_info
from functools import reduce
from operator import mul
from flask_babel import gettext
-if version_info[0] == 3:
- unicode = str
keywords = ('min',
'max',
@@ -30,21 +27,21 @@ def answer(query):
func = parts[0]
answer = None
- if func == b'min':
+ if func == 'min':
answer = min(args)
- elif func == b'max':
+ elif func == 'max':
answer = max(args)
- elif func == b'avg':
+ elif func == 'avg':
answer = sum(args) / len(args)
- elif func == b'sum':
+ elif func == 'sum':
answer = sum(args)
- elif func == b'prod':
+ elif func == 'prod':
answer = reduce(mul, args, 1)
if answer is None:
return []
- return [{'answer': unicode(answer)}]
+ return [{'answer': str(answer)}]
# required answerer function