summaryrefslogtreecommitdiff
path: root/searx/search.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/search.py')
-rw-r--r--searx/search.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/searx/search.py b/searx/search.py
index 980cfeb99..790e7d071 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -16,8 +16,8 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
'''
import gc
+import sys
import threading
-from thread import start_new_thread
from time import time
from uuid import uuid4
import requests.exceptions
@@ -33,6 +33,14 @@ from searx import logger
from searx.plugins import plugins
from searx.exceptions import SearxParameterException
+try:
+ from thread import start_new_thread
+except:
+ from _thread import start_new_thread
+
+if sys.version_info[0] == 3:
+ unicode = str
+
logger = logger.getChild('search')
number_of_searches = 0
@@ -387,7 +395,7 @@ class Search(object):
request_params['time_range'] = search_query.time_range
# append request to list
- requests.append((selected_engine['name'], search_query.query.encode('utf-8'), request_params))
+ requests.append((selected_engine['name'], search_query.query, request_params))
# update timeout_limit
timeout_limit = max(timeout_limit, engine.timeout)