Skip to content

Commit fd04f6a

Browse files
jdufresnegsnedders
authored andcommitted
Remove unnecessary use of six.binary_type (html5lib#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

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy