diff --git a/html5lib/_inputstream.py b/html5lib/_inputstream.py
index c20e94fd..62f5e9d5 100644
--- a/html5lib/_inputstream.py
+++ b/html5lib/_inputstream.py
@@ -1,6 +1,6 @@
from __future__ import absolute_import, division, unicode_literals
-from six import text_type, binary_type
+from six import text_type
from six.moves import http_client, urllib
import codecs
@@ -908,7 +908,7 @@ def parse(self):
def lookupEncoding(encoding):
"""Return the python codec name corresponding to an encoding or None if the
string doesn't correspond to a valid encoding."""
- if isinstance(encoding, binary_type):
+ if isinstance(encoding, bytes):
try:
encoding = encoding.decode("ascii")
except UnicodeDecodeError: