mirror of https://github.com/searx/searx
[fix] autocompleter py3 compatibility - fixes #1088
This commit is contained in:
parent
fe6e87a5a4
commit
f65f90bf3c
|
@ -88,6 +88,9 @@ except:
|
||||||
|
|
||||||
if sys.version_info[0] == 3:
|
if sys.version_info[0] == 3:
|
||||||
unicode = str
|
unicode = str
|
||||||
|
PY3 = True
|
||||||
|
else:
|
||||||
|
PY3 = False
|
||||||
|
|
||||||
# serve pages with HTTP/1.1
|
# serve pages with HTTP/1.1
|
||||||
from werkzeug.serving import WSGIRequestHandler
|
from werkzeug.serving import WSGIRequestHandler
|
||||||
|
@ -605,6 +608,9 @@ def autocompleter():
|
||||||
disabled_engines = request.preferences.engines.get_disabled()
|
disabled_engines = request.preferences.engines.get_disabled()
|
||||||
|
|
||||||
# parse query
|
# parse query
|
||||||
|
if PY3:
|
||||||
|
raw_text_query = RawTextQuery(request.form.get('q', b''), disabled_engines)
|
||||||
|
else:
|
||||||
raw_text_query = RawTextQuery(request.form.get('q', u'').encode('utf-8'), disabled_engines)
|
raw_text_query = RawTextQuery(request.form.get('q', u'').encode('utf-8'), disabled_engines)
|
||||||
raw_text_query.parse_query()
|
raw_text_query.parse_query()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue