py3: use bytechr() in store._buildlowerencodefun()
authorYuya Nishihara <yuya@tcha.org>
Sun, 03 Sep 2017 17:27:50 +0900
changeset 34214 7e3f078b6f31
parent 34213 96808804b68f
child 34215 b4abc438a8c9
py3: use bytechr() in store._buildlowerencodefun()
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