Skip to content

Commit 055f86f

Browse files
committed
Apply @rwgk's fixes to cherry-picked commits from pybind#2392
1 parent e71db58 commit 055f86f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_pytypes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,14 @@ def __repr__(self):
111111
assert s1 == s2
112112

113113
malformed_utf8 = b"\x80"
114+
assert m.str_from_object(malformed_utf8) is malformed_utf8 # To be fixed; see #2380
114115
if env.PY2:
116+
# with pytest.raises(UnicodeDecodeError):
117+
# m.str_from_object(malformed_utf8)
115118
with pytest.raises(UnicodeDecodeError):
116-
assert m.str_from_object(malformed_utf8)
117-
with pytest.raises(UnicodeDecodeError):
118-
assert m.str_from_handle(malformed_utf8)
119+
m.str_from_handle(malformed_utf8)
119120
else:
120-
assert m.str_from_object(malformed_utf8) == "b'\\x80'"
121+
# assert m.str_from_object(malformed_utf8) == "b'\\x80'"
121122
assert m.str_from_handle(malformed_utf8) == "b'\\x80'"
122123

123124

0 commit comments

Comments
 (0)