From 1022228d950c2a809ed613df1a515d9a6cafda7c Mon Sep 17 00:00:00 2001 From: Dalf Date: Thu, 6 Aug 2020 17:42:46 +0200 Subject: Drop Python 2 (1/n): remove unicode string and url_utils --- searx/answerers/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'searx/answerers/__init__.py') diff --git a/searx/answerers/__init__.py b/searx/answerers/__init__.py index 444316f11..47cc33ed3 100644 --- a/searx/answerers/__init__.py +++ b/searx/answerers/__init__.py @@ -1,12 +1,8 @@ from os import listdir from os.path import realpath, dirname, join, isdir -from sys import version_info from searx.utils import load_module from collections import defaultdict -if version_info[0] == 3: - unicode = str - answerers_dir = dirname(realpath(__file__)) @@ -36,10 +32,10 @@ def ask(query): results = [] query_parts = list(filter(None, query.query.split())) - if query_parts[0].decode('utf-8') not in answerers_by_keywords: + if query_parts[0].decode() not in answerers_by_keywords: return results - for answerer in answerers_by_keywords[query_parts[0].decode('utf-8')]: + for answerer in answerers_by_keywords[query_parts[0].decode()]: result = answerer(query) if result: results.append(result) -- cgit v1.2.3