[fix] check for non-None city

This commit is contained in:
Al
2016-12-10 01:23:06 -05:00
parent dc022f8652
commit 18c5fd0855

View File

@@ -1487,6 +1487,7 @@ class AddressComponents(object):
city = self.quattroshapes_city(address_components, latitude, longitude, language, non_local_language=non_local_language) city = self.quattroshapes_city(address_components, latitude, longitude, language, non_local_language=non_local_language)
if city: if city:
city = self.normalized_place_name(city, AddressFormatter.CITY, all_osm_components, country=country, languages=all_languages) city = self.normalized_place_name(city, AddressFormatter.CITY, all_osm_components, country=country, languages=all_languages)
if city:
address_components[AddressFormatter.CITY] = city address_components[AddressFormatter.CITY] = city
self.add_neighborhoods(address_components, neighborhoods, self.add_neighborhoods(address_components, neighborhoods,
@@ -1600,6 +1601,7 @@ class AddressComponents(object):
if city: if city:
city = self.normalized_place_name(city, AddressFormatter.CITY, all_osm_components, country=country, languages=all_languages) city = self.normalized_place_name(city, AddressFormatter.CITY, all_osm_components, country=country, languages=all_languages)
if city:
address_components[AddressFormatter.CITY] = city address_components[AddressFormatter.CITY] = city
self.add_neighborhoods(address_components, neighborhoods, self.add_neighborhoods(address_components, neighborhoods,