From e1cab35db0e91a7b8a0fca23d286c576513d3bff Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 28 Mar 2018 16:47:36 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: