diff options
author | Ilya Zverev <zverik@textual.ru> | 2016-11-24 17:37:26 +0300 |
---|---|---|
committer | Ilya Zverev <zverik@textual.ru> | 2016-11-24 17:37:26 +0300 |
commit | 084c22db035c2357471ee6d3950b03e3b3a0bff8 (patch) | |
tree | aec5bd0bcee1a23b0eaf380e1db7222ac9b3c9b2 /tools | |
parent | d0de17010e54e7c3dfdfc04e93f029df2588d00c (diff) |
[booking] Fix processing of empty coordinates in China
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/python/booking_hotels.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/python/booking_hotels.py b/tools/python/booking_hotels.py index 8b315d7e3e..c8bd57a342 100755 --- a/tools/python/booking_hotels.py +++ b/tools/python/booking_hotels.py @@ -145,8 +145,12 @@ def translate(source, output): # Fix chinese coordinates for hotel in data: if hotel['countrycode'] == 'cn' and 'location' in hotel: - hotel['location']['latitude'], hotel['location']['longitude'] = eviltransform.gcj2wgs_exact( - float(hotel['location']['latitude']), float(hotel['location']['longitude'])) + try: + hotel['location']['latitude'], hotel['location']['longitude'] = eviltransform.gcj2wgs_exact( + float(hotel['location']['latitude']), float(hotel['location']['longitude'])) + except ValueError: + # We don't care if there were errors converting coordinates to float + pass # Dict of dicts city_id -> { currency -> [prices] } cities = defaultdict(lambda: defaultdict(list)) |