Skip to content

Commit 97b25e3

Browse files
committed
Re-run 3to2, and fix where something had gone uncommitted in Python3 before.
1 parent 8205aae commit 97b25e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

html5lib/inputstream.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ def HTMLInputStream(source, encoding=None, parseMeta=True, chardet=True):
123123
isUnicode = isinstance(source, str)
124124

125125
if isUnicode:
126+
if encoding is not None:
127+
raise TypeError("Cannot explicitly set an encoding with a unicode string")
128+
126129
return HTMLUnicodeInputStream(source)
127130
else:
128131
return HTMLBinaryInputStream(source, encoding, parseMeta, chardet)

0 commit comments

Comments
 (0)