Skip to content

Commit

Permalink
Photon: remove unneded 'or None' that caused crashes (#439)
Browse files Browse the repository at this point in the history
I am a bit worried as I am unsure why this part of code was added
but this change is not causing any tests to fail and it fixes #436

this part of code was already in initial commit adding support to Photon,
so maybe it was simply a mistake (it was not added as an explicit workaround or fix)
  • Loading branch information
matkoniecz committed Sep 13, 2020
1 parent ea9492c commit 39934a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geopy/geocoders/photon.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ def _parse_resource(self, resource):
in name_elements if resource['properties'].get(k)]
location = ', '.join(name)

latitude = resource['geometry']['coordinates'][1] or None
longitude = resource['geometry']['coordinates'][0] or None
latitude = resource['geometry']['coordinates'][1]
longitude = resource['geometry']['coordinates'][0]
if latitude and longitude:
latitude = float(latitude)
longitude = float(longitude)
Expand Down

0 comments on commit 39934a3

Please sign in to comment.