Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/dagparser.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 | f0b6fbea00cf |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
38822:7eba8f83129b | 38823:e7aa113b14f7 |
---|---|
220 r += 1 | 220 r += 1 |
221 c = nextch() | 221 c = nextch() |
222 elif c == '+': | 222 elif c == '+': |
223 c, digs = nextrun(nextch(), pycompat.bytestr(string.digits)) | 223 c, digs = nextrun(nextch(), pycompat.bytestr(string.digits)) |
224 n = int(digs) | 224 n = int(digs) |
225 for i in xrange(0, n): | 225 for i in pycompat.xrange(0, n): |
226 yield 'n', (r, [p1]) | 226 yield 'n', (r, [p1]) |
227 p1 = r | 227 p1 = r |
228 r += 1 | 228 r += 1 |
229 elif c in '*/': | 229 elif c in '*/': |
230 if c == '*': | 230 if c == '*': |