mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 10:02:20 +02:00
Drop Python 2 (1/n): remove unicode string and url_utils
This commit is contained in:
parent
272158944b
commit
1022228d95
112 changed files with 388 additions and 535 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue