Skip to content

Commit 29e2472

Browse files
committed
fixup! Fix invalid_unicode_re on platforms supporting lone surrogates
1 parent da8f94e commit 29e2472

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

html5lib/tests/test_stream.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,11 @@ def test_invalid_codepoints(inp, num):
313313
reason="narrow Python")])
314314
def test_invalid_codepoints_surrogates(inp, num):
315315
inp = eval(inp) # pylint:disable=eval-used
316-
stream = HTMLUnicodeInputStream(StringIO(inp))
316+
fp = StringIO(inp)
317+
if ord(max(fp.read())) > 0xFFFF:
318+
pytest.skip("StringIO altered string")
319+
fp.seek(0)
320+
stream = HTMLUnicodeInputStream(fp)
317321
for _i in range(len(inp)):
318322
stream.char()
319323
assert len(stream.errors) == num

0 commit comments

Comments
 (0)