diff options
author | Dalf <alex@al-f.net> | 2020-08-06 17:42:46 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-09-10 10:39:04 +0200 |
commit | 1022228d950c2a809ed613df1a515d9a6cafda7c (patch) | |
tree | d792dddea1a5b278b018ed4e024cd13340d5c1b1 /searx/engines/openstreetmap.py | |
parent | 272158944bf13503e2597018fc60a00baddec660 (diff) | |
download | searxng-1022228d950c2a809ed613df1a515d9a6cafda7c.tar.gz searxng-1022228d950c2a809ed613df1a515d9a6cafda7c.zip |
Drop Python 2 (1/n): remove unicode string and url_utils
Diffstat (limited to 'searx/engines/openstreetmap.py')
-rw-r--r-- | searx/engines/openstreetmap.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/engines/openstreetmap.py b/searx/engines/openstreetmap.py index 257b1a1b3..48a2a14b7 100644 --- a/searx/engines/openstreetmap.py +++ b/searx/engines/openstreetmap.py @@ -30,8 +30,8 @@ route_re = re.compile('(?:from )?(.+) to (.+)') # do search-request def request(query, params): - params['url'] = base_url + search_string.format(query=query.decode('utf-8')) - params['route'] = route_re.match(query.decode('utf-8')) + params['url'] = base_url + search_string.format(query=query.decode()) + params['route'] = route_re.match(query.decode()) return params @@ -52,7 +52,7 @@ def response(resp): if 'display_name' not in r: continue - title = r['display_name'] or u'' + title = r['display_name'] or '' osm_type = r.get('osm_type', r.get('type')) url = result_base_url.format(osm_type=osm_type, osm_id=r['osm_id']) @@ -64,7 +64,7 @@ def response(resp): # if no geojson is found and osm_type is a node, add geojson Point if not geojson and osm_type == 'node': - geojson = {u'type': u'Point', u'coordinates': [r['lon'], r['lat']]} + geojson = {'type': 'Point', 'coordinates': [r['lon'], r['lat']]} address_raw = r.get('address') address = {} |