From patchwork Thu Jun 15 21:34:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3, of, 9] py3: alias long to int and xrange to range in test-ancestor.py on Python 3 From: Pulkit Goyal <7895pulkit@gmail.com> X-Patchwork-Id: 21406 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Fri, 16 Jun 2017 03:04:45 +0530 # 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 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