Skip to content

Commit 16a02f7

Browse files
committed
unicode decode failures without an installed handler raise a LookupError
from wlav@4f03d87
1 parent 8e75835 commit 16a02f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test_doc_features.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,8 +1291,9 @@ def test_unicode(self):
12911291
return to_str(chars);
12921292
}}""")
12931293

1294-
with raises(UnicodeDecodeError):
1294+
with raises(Exception) as exc_info:
12951295
CC.gbk_chinese().decode('utf-8')
1296+
assert isinstance(exc_info.value, (UnicodeDecodeError, LookupError))
12961297

12971298
assert CC.gbk_chinese() == u'\u4e2d\u6587'.encode('gbk')
12981299
if 0x3000000 <= sys.hexversion:

0 commit comments

Comments
 (0)