archrelease: copy trunk to extra-x86_64
[arch-packages.git] / python2 / repos / extra-x86_64 / py2-ize-the-CJK-codec-test.patch
blob72166c74b4b4e0cbc830a8bbd5a1aca426a90c8e
1 From ed1aa2f4738efe948242f252bcb0aa0b4314d2a2 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
3 Date: Fri, 5 Mar 2021 10:34:50 +0100
4 Subject: py2-ize the CJK codec test
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Signed-off-by: Michał Górny <mgorny@gentoo.org>
10 ---
11 Lib/test/multibytecodec_support.py | 5 +++--
12 1 file changed, 3 insertions(+), 2 deletions(-)
14 diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py
15 index b7d7a3aba7..661ef9ee37 100644
16 --- a/Lib/test/multibytecodec_support.py
17 +++ b/Lib/test/multibytecodec_support.py
18 @@ -2,6 +2,7 @@
19 # Common Unittest Routines for CJK codecs
22 +import binascii
23 import codecs
24 import os
25 import re
26 @@ -280,7 +281,7 @@ class TestBase_Mapping(unittest.TestCase):
28 def _test_mapping_file_plain(self):
29 def unichrs(s):
30 - return ''.join(chr(int(x, 16)) for x in s.split('+'))
31 + return ''.join(unichr(int(x, 16)) for x in s.split('+'))
33 urt_wa = {}
35 @@ -294,7 +295,7 @@ class TestBase_Mapping(unittest.TestCase):
37 if data[0][:2] != '0x':
38 self.fail("Invalid line: {line!r}".format(line=line))
39 - csetch = bytes.fromhex(data[0][2:])
40 + csetch = binascii.a2b_hex(data[0][2:])
41 if len(csetch) == 1 and 0x80 <= csetch[0]:
42 continue
44 --
45 cgit v1.2.3