changeset 35:815e6b61d76e

Decode to string to work with Python 3.
author Daniel O'Connor <darius@dons.net.au>
date Sat, 14 Nov 2020 15:05:07 +1030
parents b79c03810bbe
children 5dbc310f1eca
files speedcheck.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/speedcheck.py	Sat Nov 14 15:02:55 2020 +1030
+++ b/speedcheck.py	Sat Nov 14 15:05:07 2020 +1030
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 
 import configparser
 import optparse
@@ -76,7 +76,7 @@
 def testping(host):
     p = subprocess.Popen(['ping', '-c', '5', '-t', '8', '-q', host], stdout = subprocess.PIPE)
     stdout, stderr = p.communicate()
-    l = stdout.split('\n')
+    l = stdout.decode('ascii', 'ignore').split('\n')
     if len(l) != 6:
         print('Unable to parse ping line:', l)
     xx, xx, xx, plossline, latline, xx = l