8000 fix 'object of type 'type' is not iterable' in codecName · KavanLiang/html5lib-python@9dc584c · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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)
0