diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -387,8 +387,8 @@ class normcasespecs(object): other = 0 _jsonmap = [] -_jsonmap.extend("\\u%04x" % x for x in xrange(32)) -_jsonmap.extend(chr(x) for x in xrange(32, 127)) +_jsonmap.extend("\\u%04x" % x for x in range(32)) +_jsonmap.extend(chr(x) for x in range(32, 127)) _jsonmap.append('\\u007f') _jsonmap[0x09] = '\\t' _jsonmap[0x0a] = '\\n' @@ -400,7 +400,7 @@ class normcasespecs(object): _paranoidjsonmap = _jsonmap[:] _paranoidjsonmap[0x3c] = '\\u003c' # '<' (e.g. escape "") _paranoidjsonmap[0x3e] = '\\u003e' # '>' -_jsonmap.extend(chr(x) for x in xrange(128, 256)) +_jsonmap.extend(chr(x) for x in range(128, 256)) def jsonescape(s, paranoid=False): '''returns a string suitable for JSON