# HG changeset patch # User Yuya Nishihara # Date 1504427270 -32400 # Node ID 7e3f078b6f3181382635443b3babc25e68cede6a # Parent 96808804b68fb07b6b8c19d7eeb54c8864cceb5c py3: use bytechr() in store._buildlowerencodefun() diff -r 96808804b68f -r 7e3f078b6f31 mercurial/store.py --- a/mercurial/store.py Sun Sep 03 17:26:10 2017 +0900 +++ b/mercurial/store.py Sun Sep 03 17:27:50 2017 +0900 @@ -157,11 +157,12 @@ >>> f(b'the\\x07quick\\xADshot') 'the~07quick~adshot' ''' - cmap = dict([(chr(x), chr(x)) for x in xrange(127)]) + xchr = pycompat.bytechr + cmap = dict([(xchr(x), xchr(x)) for x in xrange(127)]) for x in _reserved(): - cmap[chr(x)] = "~%02x" % x + cmap[xchr(x)] = "~%02x" % x for x in range(ord("A"), ord("Z") + 1): - cmap[chr(x)] = chr(x).lower() + cmap[xchr(x)] = xchr(x).lower() def lowerencode(s): return "".join([cmap[c] for c in s]) return lowerencode