mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
Drop Python 2 (1/n): remove unicode string and url_utils
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user