Skip to content

Commit 9dc584c

Browse files
author
Mark Pilgrim
committed
fix 'object of type 'type' is not iterable' in codecName
1 parent 03c7960 commit 9dc584c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/html5lib/inputstream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def codecName(encoding):
729729
string doesn't correspond to a valid encoding."""
730730
if type(encoding) == bytes:
731731
encoding = str(encoding, "ascii")
732-
if (encoding is not None and type(encoding) in str):
732+
if (encoding is not None) and (type(encoding) == str):
733733
canonicalName = ascii_punctuation_re.sub("", encoding).lower()
734734
return encodings.get(canonicalName, None)
735735
else:

0 commit comments

Comments
 (0)