Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/encoding.py @ 49292:d44e3c45f0e4
py3: replace `pycompat.xrange` by `range`
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Sun, 29 May 2022 15:17:27 +0200 |
parents | 642e31cb55f0 |
children | 95acba2c29f6 |
comparison
equal
deleted
inserted
replaced
49291:44b26349127b | 49292:d44e3c45f0e4 |
---|---|
399 | 399 |
400 def getcols(s, start, c): | 400 def getcols(s, start, c): |
401 # type: (bytes, int, int) -> bytes | 401 # type: (bytes, int, int) -> bytes |
402 """Use colwidth to find a c-column substring of s starting at byte | 402 """Use colwidth to find a c-column substring of s starting at byte |
403 index start""" | 403 index start""" |
404 for x in pycompat.xrange(start + c, len(s)): | 404 for x in range(start + c, len(s)): |
405 t = s[start:x] | 405 t = s[start:x] |
406 if colwidth(t) == c: | 406 if colwidth(t) == c: |
407 return t | 407 return t |
408 raise ValueError('substring not found') | 408 raise ValueError('substring not found') |
409 | 409 |