sphinx / sphinx / util /

Diff from to

File sphinx/util/

 import sphinx
 from sphinx.errors import PycodeError
+from sphinx.util.pycompat import bytes
 # import other utilities; partly for backwards compatibility, so don't
 # prune unused ones indiscriminately
 def force_decode(string, encoding):
     """Forcibly get a unicode string out of a bytestring."""
-    if isinstance(string, str):
+    if isinstance(string, bytes):
         if encoding:
             string = string.decode(encoding)