svn commit: r242041 - stable/9/tools/regression/netinet/ip_id_period

Eitan Adler eadler at FreeBSD.org
Thu Oct 25 03:15:25 UTC 2012


Author: eadler
Date: Thu Oct 25 03:15:24 2012
New Revision: 242041
URL: http://svn.freebsd.org/changeset/base/242041

Log:
  MFC r241832:
  	Covert regression test to python 3
  
  Approved by:	cperciva (implicit)

Modified:
  stable/9/tools/regression/netinet/ip_id_period/ip_id_period.py
Directory Properties:
  stable/9/tools/regression/netinet/   (props changed)

Modified: stable/9/tools/regression/netinet/ip_id_period/ip_id_period.py
==============================================================================
--- stable/9/tools/regression/netinet/ip_id_period/ip_id_period.py	Thu Oct 25 03:14:17 2012	(r242040)
+++ stable/9/tools/regression/netinet/ip_id_period/ip_id_period.py	Thu Oct 25 03:15:24 2012	(r242041)
@@ -51,26 +51,26 @@ id_minperiod = {}
 count = 0
 for line in open('results.txt').readlines():
     id = int(line.split(' id ')[1].split(',')[0])
-    if id_lastseen.has_key(id):
+    if id in id_lastseen:
         period = count - id_lastseen[id]
-        if not id_minperiod.has_key(id) or period < id_minperiod[id]:
+        if id not in id_minperiod or period < id_minperiod[id]:
             id_minperiod[id] = period
     id_lastseen[id] = count
     count += 1
 
-sorted_minperiod = zip(*reversed(zip(*id_minperiod.items())))
+sorted_minperiod = list(zip(*reversed(list(zip(*list(id_minperiod.items()))))))
 sorted_minperiod.sort()
 
-print "Lowest 10 ID periods detected:"
+print("Lowest 10 ID periods detected:")
 x = 0
 while x < 10:
     id_tuple = sorted_minperiod.pop(0)
-    print "id: %d period: %d" % (id_tuple[1], id_tuple[0])
+    print("id: %d period: %d" % (id_tuple[1], id_tuple[0]))
     x += 1
 
-print "Highest 10 ID periods detected:"
+print("Highest 10 ID periods detected:")
 x = 0
 while x < 10:
     id_tuple = sorted_minperiod.pop()
-    print "id: %d period: %d" % (id_tuple[1], id_tuple[0])
+    print("id: %d period: %d" % (id_tuple[1], id_tuple[0]))
     x += 1


More information about the svn-src-stable mailing list