aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-03-05 10:34:50 +0100
committerMichał Górny <mgorny@gentoo.org>2021-03-05 10:34:50 +0100
commited1aa2f4738efe948242f252bcb0aa0b4314d2a2 (patch)
tree4362b176d28ac77eb24ba976277f4a9c06ca9df5
parent[3.6] bpo-42967: only use '&' as a query string separator (GH-24297) (GH-24532) (diff)
downloadcpython-ed1aa2f4738efe948242f252bcb0aa0b4314d2a2.tar.gz
cpython-ed1aa2f4738efe948242f252bcb0aa0b4314d2a2.tar.bz2
cpython-ed1aa2f4738efe948242f252bcb0aa0b4314d2a2.zip
py2-ize the CJK codec test
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--Lib/test/multibytecodec_support.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py
index b7d7a3aba70..661ef9ee37a 100644
--- a/Lib/test/multibytecodec_support.py
+++ b/Lib/test/multibytecodec_support.py
@@ -2,6 +2,7 @@
# Common Unittest Routines for CJK codecs
#
+import binascii
import codecs
import os
import re
@@ -280,7 +281,7 @@ class TestBase_Mapping(unittest.TestCase):
def _test_mapping_file_plain(self):
def unichrs(s):
- return ''.join(chr(int(x, 16)) for x in s.split('+'))
+ return ''.join(unichr(int(x, 16)) for x in s.split('+'))
urt_wa = {}
@@ -294,7 +295,7 @@ class TestBase_Mapping(unittest.TestCase):
if data[0][:2] != '0x':
self.fail("Invalid line: {line!r}".format(line=line))
- csetch = bytes.fromhex(data[0][2:])
+ csetch = binascii.a2b_hex(data[0][2:])
if len(csetch) == 1 and 0x80 <= csetch[0]:
continue