diff --git a/apps/users/utils.py b/apps/users/utils.py index abc4b2018..c8a5b60a8 100644 --- a/apps/users/utils.py +++ b/apps/users/utils.py @@ -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 try: r = requests.get(url, timeout=timeout) - except requests.Timeout: + except: r = None city = 'Unknown' if r and r.status_code == 200: