diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py index 5cbe4ff66..e3f8dc275 100644 --- a/sphinx/ext/intersphinx.py +++ b/sphinx/ext/intersphinx.py @@ -427,6 +427,6 @@ def inspect_main(argv): if __name__ == '__main__': import logging # type: ignore - logging.basicConfig() + logging.basicConfig() # type: ignore inspect_main(argv=sys.argv[1:]) # type: ignore diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index a97903a27..3e70e28ce 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -32,7 +32,7 @@ class ModuleAnalyzer(object): def for_string(cls, string, modname, srcname=''): # type: (unicode, unicode, unicode) -> ModuleAnalyzer if isinstance(string, bytes): - return cls(BytesIO(string), modname, srcname) + return cls(BytesIO(string), modname, srcname) # type: ignore return cls(StringIO(string), modname, srcname, decoded=True) # type: ignore @classmethod diff --git a/sphinx/testing/path.py b/sphinx/testing/path.py index 585933499..1c9781dea 100644 --- a/sphinx/testing/path.py +++ b/sphinx/testing/path.py @@ -30,7 +30,7 @@ class path(text_type): # type: (unicode, unicode, unicode) -> path if isinstance(s, str): s = s.decode(encoding, errors) - return text_type.__new__(cls, s) + return text_type.__new__(cls, s) # type: ignore return text_type.__new__(cls, s) # type: ignore @property diff --git a/sphinx/util/images.py b/sphinx/util/images.py index c385c19a9..d5e0db2d7 100644 --- a/sphinx/util/images.py +++ b/sphinx/util/images.py @@ -73,7 +73,7 @@ def get_image_size(filename): def guess_mimetype_for_stream(stream, default=None): # type: (IO, unicode) -> unicode - imgtype = imghdr.what(stream) + imgtype = imghdr.what(stream) # type: ignore if imgtype: return 'image/' + imgtype else: @@ -141,4 +141,4 @@ def test_svg(h, f): # install test_svg() to imghdr # refs: https://docs.python.org/3.6/library/imghdr.html#imghdr.tests -imghdr.tests.append(test_svg) +imghdr.tests.append(test_svg) # type: ignore diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index 986171293..4c75009ee 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -235,7 +235,7 @@ def abspath(pathdir): try: pathdir = pathdir.decode(fs_encoding) except UnicodeDecodeError: - raise UnicodeDecodeError('multibyte filename not supported on ' + raise UnicodeDecodeError('multibyte filename not supported on ' # type: ignore 'this filesystem encoding ' '(%r)' % fs_encoding) return pathdir diff --git a/sphinx/util/requests.py b/sphinx/util/requests.py index b6c0d1ab8..65ddaedb7 100644 --- a/sphinx/util/requests.py +++ b/sphinx/util/requests.py @@ -34,7 +34,7 @@ except ImportError: from urllib3.exceptions import InsecureRequestWarning # type: ignore except ImportError: # for requests < 2.4.0 - InsecureRequestWarning = None + InsecureRequestWarning = None # type: ignore try: from requests.packages.urllib3.exceptions import InsecurePlatformWarning @@ -44,7 +44,7 @@ except ImportError: from urllib3.exceptions import InsecurePlatformWarning # type: ignore except ImportError: # for requests < 2.4.0 - InsecurePlatformWarning = None + InsecurePlatformWarning = None # type: ignore # try to load requests[security] (but only if SSL is available) try: