py3: use pycompat.bytechr instead of chr
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 03 May 2017 15:37:51 +0530
changeset 32156 6c0ae9683437
parent 32155 055cca8e167b
child 32157 09fb3d3b1b3a
py3: use pycompat.bytechr instead of chr
mercurial/encoding.py
--- a/mercurial/encoding.py	Fri May 05 01:41:54 2017 +0530
+++ b/mercurial/encoding.py	Wed May 03 15:37:51 2017 +0530
@@ -429,7 +429,7 @@
 
 _jsonmap = []
 _jsonmap.extend("\\u%04x" % x for x in range(32))
-_jsonmap.extend(chr(x) for x in range(32, 127))
+_jsonmap.extend(pycompat.bytechr(x) for x in range(32, 127))
 _jsonmap.append('\\u007f')
 _jsonmap[0x09] = '\\t'
 _jsonmap[0x0a] = '\\n'
@@ -441,7 +441,7 @@
 _paranoidjsonmap = _jsonmap[:]
 _paranoidjsonmap[0x3c] = '\\u003c'  # '<' (e.g. escape "</script>")
 _paranoidjsonmap[0x3e] = '\\u003e'  # '>'
-_jsonmap.extend(chr(x) for x in range(128, 256))
+_jsonmap.extend(pycompat.bytechr(x) for x in range(128, 256))
 
 def jsonescape(s, paranoid=False):
     '''returns a string suitable for JSON