Mercurial > hg-stable
diff mercurial/utils/stringutil.py @ 38823: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 | a3130208db1c |
children | 2aebe138ef6e |
line wrap: on
line diff
--- a/mercurial/utils/stringutil.py Wed Aug 01 12:57:15 2018 -0700 +++ b/mercurial/utils/stringutil.py Wed Aug 01 13:00:45 2018 -0700 @@ -464,7 +464,7 @@ def _cutdown(self, ucstr, space_left): l = 0 colwidth = encoding.ucolwidth - for i in xrange(len(ucstr)): + for i in pycompat.xrange(len(ucstr)): l += colwidth(ucstr[i]) if space_left < l: return (ucstr[:i], ucstr[i:])