mirror of
https://github.com/chubin/wttr.in
synced 2024-12-25 11:23:04 +00:00
lib/location.py: location can be None (#296)
This commit is contained in:
parent
6b7e083df3
commit
e1930bedfb
1 changed files with 1 additions and 1 deletions
|
@ -108,7 +108,7 @@ def ip2location(ip_addr):
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if ';' in location:
|
if location and ';' in location:
|
||||||
location = location.split(';')[3], location.split(';')[1]
|
location = location.split(';')[3], location.split(';')[1]
|
||||||
else:
|
else:
|
||||||
location = location, None
|
location = location, None
|
||||||
|
|
Loading…
Reference in a new issue