D6920: contrib: use pycompat.xrange in bdiff-torture.py

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Sun Sep 29 15:25:34 EDT 2019


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  For Python 3 compatibility.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6920

AFFECTED FILES
  contrib/bdiff-torture.py

CHANGE DETAILS

diff --git a/contrib/bdiff-torture.py b/contrib/bdiff-torture.py
--- a/contrib/bdiff-torture.py
+++ b/contrib/bdiff-torture.py
@@ -6,6 +6,7 @@
 
 from mercurial import (
     mdiff,
+    pycompat,
 )
 
 def reducetest(a, b):
@@ -63,7 +64,7 @@
 def rndtest(size, noise):
     a = []
     src = "                aaaaaaaabbbbccd"
-    for x in xrange(size):
+    for x in pycompat.xrange(size):
         a.append(src[random.randint(0, len(src) - 1)])
 
     while True:



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list