- data = []
-
- for line in f:
- # match traceroute to ...
- m = re.match(_rre, line)
- if not m:
- continue
-
- target_ip = m.groupdict()["ip"]
- # FIX THIS: Make sure the regular expression does not inlcude
- # the ')' in the ip group
- target_ip = target_ip.replace(")","")
- target_hostname = m.groupdict()["hostname"]
- time = m.groupdict()["time"]
- data.append((target_ip, target_hostname, time))
-
- f.close()
+ data = []
+
+ for line in f:
+ # match traceroute to ...
+ m = re.match(_rre, line)
+ if not m:
+ continue
+
+ target_ip = m.groupdict()["ip"]
+ # FIX THIS: Make sure the regular expression does not inlcude
+ # the ')' in the ip group
+ target_ip = target_ip.replace(")","")
+ target_hostname = m.groupdict()["hostname"]
+ time = m.groupdict()["time"]
+ data.append((target_ip, target_hostname, time))