Mercurial > ~darius > hgwebdir.cgi > adslstats
diff speedcheck.py @ 40:947fa4062b01 default tip
Don't blow up if ping fails.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Tue, 29 Nov 2022 11:53:06 +1030 |
parents | 1a87c79cf103 |
children |
line wrap: on
line diff
--- a/speedcheck.py Mon Jul 04 13:18:58 2022 +0930 +++ b/speedcheck.py Tue Nov 29 11:53:06 2022 +1030 @@ -79,6 +79,7 @@ l = stdout.decode('ascii', 'ignore').split('\n') if len(l) != 6: print('Unable to parse ping line:', l) + return float('nan'), float('nan') xx, xx, xx, plossline, latline, xx = l ploss = re.match('.* received, ([0-9.]+)% packet loss', plossline) if ploss is not None: