summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-12-15 11:39:14 -0800
committerJon Dufresne <jon.dufresne@gmail.com>2018-12-15 11:39:14 -0800
commitee8b403142394938c1295a6b34703f82c6ac38f2 (patch)
tree589322fd1b681aa8dc71978171eec33d01919b89
parent6113261948523ef6cad74621dec10e0cbf0189c7 (diff)
downloadsphinx-git-ee8b403142394938c1295a6b34703f82c6ac38f2.tar.gz
Remove unnecessary bytes type check in ModuleAnalyzer.for_string()
All uses always pass a str, never a bytes. Per the type signature, only str types are allowed.
-rw-r--r--sphinx/pycode/__init__.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py
index e3e80772c..4d21e43ea 100644
--- a/sphinx/pycode/__init__.py
+++ b/sphinx/pycode/__init__.py
@@ -10,7 +10,7 @@
"""
import re
-from io import BytesIO, StringIO
+from io import StringIO
from zipfile import ZipFile
from sphinx.errors import PycodeError
@@ -29,8 +29,6 @@ class ModuleAnalyzer:
@classmethod
def for_string(cls, string, modname, srcname='<string>'):
# type: (str, str, str) -> ModuleAnalyzer
- if isinstance(string, bytes):
- return cls(BytesIO(string), modname, srcname)
return cls(StringIO(string), modname, srcname, decoded=True)
@classmethod