Mercurial > hg
comparison mercurial/wireprotov1peer.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 | aa9dd805234d |
children | f15a587d2dfc |
comparison
equal
deleted
inserted
replaced
38782:7eba8f83129b | 38783:e7aa113b14f7 |
---|---|
495 self._abort(error.ResponseError(_("unexpected response:"), d)) | 495 self._abort(error.ResponseError(_("unexpected response:"), d)) |
496 | 496 |
497 def between(self, pairs): | 497 def between(self, pairs): |
498 batch = 8 # avoid giant requests | 498 batch = 8 # avoid giant requests |
499 r = [] | 499 r = [] |
500 for i in xrange(0, len(pairs), batch): | 500 for i in pycompat.xrange(0, len(pairs), batch): |
501 n = " ".join([wireprototypes.encodelist(p, '-') | 501 n = " ".join([wireprototypes.encodelist(p, '-') |
502 for p in pairs[i:i + batch]]) | 502 for p in pairs[i:i + batch]]) |
503 d = self._call("between", pairs=n) | 503 d = self._call("between", pairs=n) |
504 try: | 504 try: |
505 r.extend(l and wireprototypes.decodelist(l) or [] | 505 r.extend(l and wireprototypes.decodelist(l) or [] |