Skip to content

Commit fd04f6a

Browse files
jdufresnegsnedders
authored andcommitted
Remove unnecessary use of six.binary_type (#400)
The bytes type is available on all support Pythons. On Python 2 it is an alias of str (same as six). Reduce unnecessary compatibility shims and by using modern Python idioms. Makes the code more forward compatible with Python 3.
1 parent 7facf98 commit fd04f6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

html5lib/_inputstream.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import, division, unicode_literals
22

3-
from six import text_type, binary_type
3+
from six import text_type
44
from six.moves import http_client, urllib
55

66
import codecs
@@ -908,7 +908,7 @@ def parse(self):
908908
def lookupEncoding(encoding):
909909
"""Return the python codec name corresponding to an encoding or None if the
910910
string doesn't correspond to a valid encoding."""
911-
if isinstance(encoding, binary_type):
911+
if isinstance(encoding, bytes):
912912
try:
913913
encoding = encoding.decode("ascii")
914914
except UnicodeDecodeError:

0 commit comments

Comments
 (0)