Fix mypy violations

This commit is contained in:
Takeshi KOMIYA 2019-01-17 23:45:30 +09:00
parent 06da488f6f
commit c8c82d7cef
4 changed files with 4 additions and 4 deletions

View File

@ -244,7 +244,7 @@ def load_mappings(app):
# files; remote ones only if the cache time is expired
if '://' not in inv or uri not in inventories.cache \
or inventories.cache[uri][1] < cache_time:
safe_inv_url = _get_safe_url(inv) # type: ignore
safe_inv_url = _get_safe_url(inv)
logger.info('loading intersphinx inventory from %s...', safe_inv_url)
try:
invdata = fetch_inventory(app, uri, inv)

View File

@ -124,7 +124,7 @@ class SphinxWarningLogRecord(SphinxLogRecord):
class SphinxLoggerAdapter(logging.LoggerAdapter):
"""LoggerAdapter allowing ``type`` and ``subtype`` keywords."""
def log(self, level, msg, *args, **kwargs): # type: ignore
def log(self, level, msg, *args, **kwargs):
# type: (Union[int, str], unicode, Any, Any) -> None
if isinstance(level, int):
super(SphinxLoggerAdapter, self).log(level, msg, *args, **kwargs)

View File

@ -576,7 +576,7 @@ class HTMLTranslator(BaseTranslator):
self.context.append('</a>')
elif 'filename' in node:
atts['class'] += ' internal'
atts['href'] = posixpath.join(self.builder.dlpath, node['filename'])
atts['href'] = posixpath.join(self.builder.dlpath, node['filename']) # type: ignore # NOQA
self.body.append(self.starttag(node, 'a', '', **atts))
self.context.append('</a>')
else:

View File

@ -522,7 +522,7 @@ class HTML5Translator(BaseTranslator):
self.context.append('</a>')
elif 'filename' in node:
atts['class'] += ' internal'
atts['href'] = posixpath.join(self.builder.dlpath, node['filename'])
atts['href'] = posixpath.join(self.builder.dlpath, node['filename']) # type: ignore # NOQA
self.body.append(self.starttag(node, 'a', '', **atts))
self.context.append('</a>')
else: