changeset 32893:a8dfa35a4130

py3: pass range() into list() to get one explicitly range() on python 3 returns a generator whereas on python 2 returns a list. So to get a list on python 3, we passed it into list()
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 17 Jun 2017 14:38:02 +0530
parents a7851519ea02
children ec9ed269edc3
files tests/test-ancestor.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-ancestor.py	Sun May 28 00:12:38 2017 +0200
+++ b/tests/test-ancestor.py	Sat Jun 17 14:38:02 2017 +0530
@@ -42,7 +42,7 @@
                 p1 = i - 1
             else:
                 p1 = rng.randrange(i - 1)
-            p2 = rng.choice(range(0, p1) + range(p1 + 1, i))
+            p2 = rng.choice(list(range(0, p1)) + list(range(p1 + 1, i)))
             graph[i] = [p1, p2]
         elif rng.random() < prevprob:
             graph[i] = [i - 1]