src/consensus/consensus-simulation: Use past.builtins for xrange
authorNils Gillmann <ng0@n0.is>
Sat, 19 May 2018 17:21:42 +0000 (17:21 +0000)
committerNils Gillmann <ng0@n0.is>
Sat, 19 May 2018 17:21:42 +0000 (17:21 +0000)
Signed-off-by: Nils Gillmann <ng0@n0.is>
README
src/consensus/consensus-simulation.py.in

diff --git a/README b/README
index f52fca44402129d55bd2752dcc480c0621145164..80a87d274142d94785c64d665c631e9f4e359a36 100644 (file)
--- a/README
+++ b/README
@@ -264,8 +264,8 @@ $ make
 $ make install
 $ make check
 
-Some of the testcases require python >= 2.6 and pexpect to be
-installed.  If any testcases fail to pass on your system, run
+Some of the testcases require python >= 2.6 (+ the python module "futures")
+and pexpect to be installed.  If any testcases fail to pass on your system, run
 "contrib/scripts/report.sh" (in the repository) or "gnunet-bugreport"
 when you already have GNUnet installed and report the output together with
 information about the failing testcase to the Mantis bugtracking
index 12bef871d5afd1d0234a394dd91ec1835c5f0f0f..6629ffaa8876b286578471c252cf498d2e3d07e9 100644 (file)
@@ -22,6 +22,7 @@ from __future__ import print_function
 import argparse
 import random
 from math import ceil, log, floor
+from past.builtins import xrange
 
 
 def bsc(n):
@@ -44,6 +45,8 @@ def simulate(k, n, verbose):
         print("we have", num_ghosts, "ghost peers")
         # n.b. all peers with idx<k are evil
     peers = range(n)
+    # py2-3 compatible, backwards.
+    # refer to http://python-future.org/compatible_idioms.html#xrange
     info = [1 << x for x in xrange(n)]
 
     def done_p():