Commit e9631e5d authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #15378: Fix Tools/unicode/comparecodecs.py. Patch by Serhiy Storchaka.

parents a3f862e9 31605ace
...@@ -207,5 +207,7 @@ Documentation ...@@ -207,5 +207,7 @@ Documentation
Tools/Demos Tools/Demos
----------- -----------
- Issue #15378: Fix Tools/unicode/comparecodecs.py. Patch by Serhiy Storchaka.
**(For information about older versions, consult the HISTORY file.)** **(For information about older versions, consult the HISTORY file.)**
...@@ -30,7 +30,7 @@ def compare_codecs(encoding1, encoding2): ...@@ -30,7 +30,7 @@ def compare_codecs(encoding1, encoding2):
mismatch += 1 mismatch += 1
# Check decoding # Check decoding
for i in range(256): for i in range(256):
c = chr(i) c = bytes([i])
try: try:
u1 = c.decode(encoding1) u1 = c.decode(encoding1)
except UnicodeError: except UnicodeError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment