mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#13054: fix usage of sys.maxunicode after PEP-393.
This commit is contained in:
parent
b7591d4780
commit
a9860aeb08
7 changed files with 15 additions and 38 deletions
|
@ -247,14 +247,9 @@ class Test_ISO2022(unittest.TestCase):
|
|||
self.assertFalse(any(x > 0x80 for x in e))
|
||||
|
||||
def test_bug1572832(self):
|
||||
if sys.maxunicode >= 0x10000:
|
||||
myunichr = chr
|
||||
else:
|
||||
myunichr = lambda x: chr(0xD7C0+(x>>10)) + chr(0xDC00+(x&0x3FF))
|
||||
|
||||
for x in range(0x10000, 0x110000):
|
||||
# Any ISO 2022 codec will cause the segfault
|
||||
myunichr(x).encode('iso_2022_jp', 'ignore')
|
||||
chr(x).encode('iso_2022_jp', 'ignore')
|
||||
|
||||
class TestStateful(unittest.TestCase):
|
||||
text = '\u4E16\u4E16'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue