mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
commit
914d93a9e1
@ -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
|
||||
|
@ -32,7 +32,7 @@ class ModuleAnalyzer(object):
|
||||
def for_string(cls, string, modname, srcname='<string>'):
|
||||
# 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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user