Mercurial > hg
changeset 34217:5307cc57f271
py3: don't pass bytes to array.array()
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 16 Sep 2017 22:42:19 +0900 |
parents | 1c601df9894c |
children | aa877860d4d7 |
files | mercurial/pure/charencode.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/pure/charencode.py Sun Sep 03 15:54:29 2017 +0900 +++ b/mercurial/pure/charencode.py Sat Sep 16 22:42:19 2017 +0900 @@ -74,6 +74,6 @@ else: jm = _jsonmap # non-BMP char is represented as UTF-16 surrogate pair - u16codes = array.array('H', u8chars.decode('utf-8').encode('utf-16')) + u16codes = array.array(r'H', u8chars.decode('utf-8').encode('utf-16')) u16codes.pop(0) # drop BOM return ''.join(jm[x] if x < 128 else '\\u%04x' % x for x in u16codes)