Mercurial > hg
changeset 32156:6c0ae9683437
py3: use pycompat.bytechr instead of chr
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 03 May 2017 15:37:51 +0530 |
parents | 055cca8e167b |
children | 09fb3d3b1b3a |
files | mercurial/encoding.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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