Mercurial > public > mercurial-scm > hg
comparison mercurial/wireprotoserver.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 | bfe8ef6e370e |
children | 5f4a9ada5ab5 |
comparison
equal
deleted
inserted
replaced
38782:7eba8f83129b | 38783:e7aa113b14f7 |
---|---|
500 return wireprototypes.SSHV1 | 500 return wireprototypes.SSHV1 |
501 | 501 |
502 def getargs(self, args): | 502 def getargs(self, args): |
503 data = {} | 503 data = {} |
504 keys = args.split() | 504 keys = args.split() |
505 for n in xrange(len(keys)): | 505 for n in pycompat.xrange(len(keys)): |
506 argline = self._fin.readline()[:-1] | 506 argline = self._fin.readline()[:-1] |
507 arg, l = argline.split() | 507 arg, l = argline.split() |
508 if arg not in keys: | 508 if arg not in keys: |
509 raise error.Abort(_("unexpected parameter %r") % arg) | 509 raise error.Abort(_("unexpected parameter %r") % arg) |
510 if arg == '*': | 510 if arg == '*': |
511 star = {} | 511 star = {} |
512 for k in xrange(int(l)): | 512 for k in pycompat.xrange(int(l)): |
513 argline = self._fin.readline()[:-1] | 513 argline = self._fin.readline()[:-1] |
514 arg, l = argline.split() | 514 arg, l = argline.split() |
515 val = self._fin.read(int(l)) | 515 val = self._fin.read(int(l)) |
516 star[arg] = val | 516 star[arg] = val |
517 data['*'] = star | 517 data['*'] = star |