Commit b959f1f6 authored by ibuler's avatar ibuler

Merge branch 'bugfix_ip_lookup' into dev

parents 8014cc48 e1cab35d
...@@ -200,7 +200,7 @@ def get_ip_city(ip, timeout=10): ...@@ -200,7 +200,7 @@ def get_ip_city(ip, timeout=10):
url = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=%s&format=json' % ip url = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=%s&format=json' % ip
try: try:
r = requests.get(url, timeout=timeout) r = requests.get(url, timeout=timeout)
except requests.Timeout: except:
r = None r = None
city = 'Unknown' city = 'Unknown'
if r and r.status_code == 200: if r and r.status_code == 200:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment