Patchwork [3,of,9] py3: alias long to int and xrange to range in test-ancestor.py on Python 3

login
register
mail settings
Submitter Pulkit Goyal
Date June 15, 2017, 9:34 p.m.
Message ID <b48856aec0e1eaf2b2f1.1497562485@workspace>
Download mbox | patch
Permalink /patch/21406/
State Accepted
Headers show

Comments

Pulkit Goyal - June 15, 2017, 9:34 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1497556471 -19800
#      Fri Jun 16 01:24:31 2017 +0530
# Node ID b48856aec0e1eaf2b2f18e7b1b2aec2ae051d097
# Parent  8a4aa371b00bd7a7533459ee6ac8a3a07f0fa98e
py3: alias long to int and xrange to range in test-ancestor.py on Python 3

Patch

diff --git a/tests/test-ancestor.py b/tests/test-ancestor.py
--- a/tests/test-ancestor.py
+++ b/tests/test-ancestor.py
@@ -13,10 +13,15 @@ 
     ancestor,
     debugcommands,
     hg,
+    pycompat,
     ui as uimod,
     util,
 )
 
+if pycompat.ispy3:
+    long = int
+    xrange = range
+
 def buildgraph(rng, nodes=100, rootprob=0.05, mergeprob=0.2, prevprob=0.7):
     '''nodes: total number of nodes in the graph
     rootprob: probability that a new node (not 0) will be a root