Fixing issue when there are no ping matches

This commit is contained in:
Will Bradley 2013-12-16 13:48:47 -07:00
parent bc1c97ccf6
commit 91e91128f9

View File

@ -66,10 +66,10 @@ class Pinger:
stderr = subprocess.PIPE
)
out, error = ping.communicate()
if error:
m = re.search('time=(.*) ms', out)
if error or m == None:
label = "PING FAIL"
else:
m = re.search('time=(.*) ms', out)
label = m.group(1)+" ms"
self.ind.set_label (label, "100.0 ms")
#self.ping_menu_item.set_label(out)