From 6d777db198759b36d021ba1f65c80a6ccd0a6623 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Thu, 5 Dec 2013 13:37:56 -0600 Subject: [PATCH] Also catch URLError when trying to fetch latency.txt. Fixes #41 --- speedtest_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index b5e9ef8..bc219f9 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -391,7 +391,7 @@ def getBestServer(servers): for i in range(0, 3): try: uh = urlopen('%s/latency.txt' % url) - except HTTPError: + except (HTTPError, URLError): cum.append(3600) continue start = time.time()