comparison mercurial/pure/charencode.py @ 48907:b677bccf74b9

charencode: remove Python 2 support code Differential Revision: https://phab.mercurial-scm.org/D12310
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 10:47:31 -0700
parents 6000f5b25c9b
children 43adbe03079b
comparison
equal deleted inserted replaced
48906:e453c69821f8 48907:b677bccf74b9
65 return b''.join(jm[x] for x in bytearray(u8chars)) 65 return b''.join(jm[x] for x in bytearray(u8chars))
66 except IndexError: 66 except IndexError:
67 raise ValueError 67 raise ValueError
68 68
69 69
70 if pycompat.ispy3: 70 _utf8strict = r'surrogatepass'
71 _utf8strict = r'surrogatepass'
72 else:
73 _utf8strict = r'strict'
74 71
75 72
76 def jsonescapeu8fallback(u8chars, paranoid): 73 def jsonescapeu8fallback(u8chars, paranoid):
77 """Convert a UTF-8 byte string to JSON-escaped form (slow path) 74 """Convert a UTF-8 byte string to JSON-escaped form (slow path)
78 75