diff hgext/beautifygraph.py @ 38783:e7aa113b14f7

global: use pycompat.xrange() On Python 3, our module importer automatically rewrites xrange() to pycompat.xrange(). We want to move away from the custom importer on Python 3. This commit converts all instances of xrange() to use pycompat.xrange(). Differential Revision: https://phab.mercurial-scm.org/D4032
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 01 Aug 2018 13:00:45 -0700
parents 9abe91a503da
children 836433f3bdd6
line wrap: on
line diff
--- a/hgext/beautifygraph.py	Wed Aug 01 12:57:15 2018 -0700
+++ b/hgext/beautifygraph.py	Wed Aug 01 13:00:45 2018 -0700
@@ -18,6 +18,7 @@
     encoding,
     extensions,
     graphmod,
+    pycompat,
     templatekw,
 )
 
@@ -53,7 +54,7 @@
 def convertedges(line):
     line = ' %s ' % line
     pretty = []
-    for idx in xrange(len(line) - 2):
+    for idx in pycompat.xrange(len(line) - 2):
         pretty.append(prettyedge(line[idx], line[idx + 1], line[idx + 2]))
     return ''.join(pretty)