diff options
author | Adam Tauber <asciimoo@gmail.com> | 2016-11-30 18:43:03 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-05-15 12:02:30 +0200 |
commit | 52e615dede8538c36f569d2cf07835427a9a0db6 (patch) | |
tree | ac65990c72156def2d49e81d981f0b3beda4fd2e /searx/engines/json_engine.py | |
parent | 46a2c63f8e1c3819cceff2d61fe9106051e8ecee (diff) | |
download | searxng-52e615dede8538c36f569d2cf07835427a9a0db6.tar.gz searxng-52e615dede8538c36f569d2cf07835427a9a0db6.zip |
[enh] py3 compatibility
Diffstat (limited to 'searx/engines/json_engine.py')
-rw-r--r-- | searx/engines/json_engine.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/searx/engines/json_engine.py b/searx/engines/json_engine.py index 4604c3cac..67d6a5a65 100644 --- a/searx/engines/json_engine.py +++ b/searx/engines/json_engine.py @@ -1,11 +1,16 @@ -from urllib import urlencode -from json import loads from collections import Iterable +from json import loads +from sys import version_info +from searx.url_utils import urlencode + +if version_info[0] == 3: + unicode = str search_url = None url_query = None content_query = None title_query = None +paging = False suggestion_query = '' results_query = '' @@ -20,7 +25,7 @@ first_page_num = 1 def iterate(iterable): if type(iterable) == dict: - it = iterable.iteritems() + it = iterable.items() else: it = enumerate(iterable) |