From d5ac864a9780f88cb4302b9b6570ce097196a8b8 Mon Sep 17 00:00:00 2001 From: Ro Date: Mon, 22 Aug 2016 22:47:22 -0400 Subject: [PATCH] Update __init__.py --- pokemongo_bot/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index 3fd04997a8..65a13863e6 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -1058,14 +1058,14 @@ def get_pos_by_name(self, location_name): possible_coordinates = re.findall( "[-]?\d{1,3}[.]\d{3,7}", location_name ) - if len(possible_coordinates) == 2: + if len(possible_coordinates) >= 2: # 2 matches, this must be a coordinate. We'll bypass the Google # geocode so we keep the exact location. self.logger.info( '[x] Coordinates found in passed in location, ' 'not geocoding.' ) - return float(possible_coordinates[0]), float(possible_coordinates[1]), self.alt + return float(possible_coordinates[0]), float(possible_coordinates[1]), (float(possible_coordinates[2]) if len(possible_coordinates) == 3 else self.alt) geolocator = GoogleV3(api_key=self.config.gmapkey) loc = geolocator.geocode(location_name, timeout=10)