summaryrefslogtreecommitdiff
path: root/src/consensus
diff options
context:
space:
mode:
authorNils Gillmann <ng0@n0.is>2018-05-19 17:21:42 +0000
committerNils Gillmann <ng0@n0.is>2018-05-19 17:21:42 +0000
commit26d49c72e190013e99fdec3bd8f065e522b582ae (patch)
tree67f62ff71e3cbc38f9ccb2359a9e114942d84d71 /src/consensus
parentf3890127696c24740fc94056b93d9918e0cbc006 (diff)
src/consensus/consensus-simulation: Use past.builtins for xrange
Signed-off-by: Nils Gillmann <ng0@n0.is>
Diffstat (limited to 'src/consensus')
-rw-r--r--src/consensus/consensus-simulation.py.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/consensus/consensus-simulation.py.in b/src/consensus/consensus-simulation.py.in
index 12bef871d..6629ffaa8 100644
--- a/src/consensus/consensus-simulation.py.in
+++ b/src/consensus/consensus-simulation.py.in
@@ -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():