From 31e53e8bc4b0a8a99eeaabdd039f3a2a2e18a84b Mon Sep 17 00:00:00 2001 From: Evelyn Date: Fri, 3 Nov 2017 19:20:23 +0000 Subject: Add default timeout --- Utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils.py b/Utils.py index 28c8b466..03b7bd31 100644 --- a/Utils.py +++ b/Utils.py @@ -52,7 +52,7 @@ def get_url(url, **kwargs): request.method = method try: - response = urllib.request.urlopen(request) + response = urllib.request.urlopen(request, timeout=5) except urllib.error.HTTPError as e: traceback.print_exc() if kwargs.get("code"): -- cgit v1.3.1-10-gc9f91