Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Oct 2012 03:15:33 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r242042 - stable/8/tools/regression/netinet/ip_id_period
Message-ID:  <201210250315.q9P3FXu2058896@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Thu Oct 25 03:15:33 2012
New Revision: 242042
URL: http://svn.freebsd.org/changeset/base/242042

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

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

Modified: stable/8/tools/regression/netinet/ip_id_period/ip_id_period.py
==============================================================================
--- stable/8/tools/regression/netinet/ip_id_period/ip_id_period.py	Thu Oct 25 03:15:24 2012	(r242041)
+++ stable/8/tools/regression/netinet/ip_id_period/ip_id_period.py	Thu Oct 25 03:15:33 2012	(r242042)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210250315.q9P3FXu2058896>