From b846f4dd88ca82f3aaaea2e32feebcafbce27ad2 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 28 Feb 2014 12:16:46 -0600 Subject: [PATCH] Handle issues determining distance to test servers --- speedtest_cli.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index 8b7d043..3b657cf 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -550,8 +550,13 @@ class Speedtest(object): if int(attrib.get('id')) in self.config['ignore_servers']: continue - d = distance(self.lat_lon, - (float(attrib.get('lat')), float(attrib.get('lon')))) + try: + d = distance(self.lat_lon, + (float(attrib.get('lat')), + float(attrib.get('lon')))) + except: + continue + attrib['d'] = d try: