Skip to content

Commit 5e218da

Browse files
committed
unicode decode failures without an installed handler raise a LookupError
from wlav@4f03d87
1 parent 7937573 commit 5e218da

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
@@ -1295,8 +1295,9 @@ def test_unicode(self):
12951295
return to_str(chars);
12961296
}}""")
12971297

1298-
with raises(UnicodeDecodeError):
1298+
with raises(Exception) as exc_info:
12991299
CC.gbk_chinese().decode('utf-8')
1300+
assert isinstance(exc_info.value, (UnicodeDecodeError, LookupError))
13001301

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

0 commit comments

Comments
 (0)