Merge pull request #5962 from tk0miya/mypy-0.660

Fix mypy violations
This commit is contained in:
Takeshi KOMIYA 2019-01-18 00:00:36 +09:00 committed by GitHub
commit 087d436309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 # files; remote ones only if the cache time is expired
if '://' not in inv or uri not in inventories.cache \ if '://' not in inv or uri not in inventories.cache \
or inventories.cache[uri][1] < cache_time: 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) logger.info('loading intersphinx inventory from %s...', safe_inv_url)
try: try:
invdata = fetch_inventory(app, uri, inv) invdata = fetch_inventory(app, uri, inv)

View File

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

View File

@ -576,7 +576,7 @@ class HTMLTranslator(BaseTranslator):
self.context.append('</a>') self.context.append('</a>')
elif 'filename' in node: elif 'filename' in node:
atts['class'] += ' internal' 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.body.append(self.starttag(node, 'a', '', **atts))
self.context.append('</a>') self.context.append('</a>')
else: else:

View File

@ -522,7 +522,7 @@ class HTML5Translator(BaseTranslator):
self.context.append('</a>') self.context.append('</a>')
elif 'filename' in node: elif 'filename' in node:
atts['class'] += ' internal' 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.body.append(self.starttag(node, 'a', '', **atts))
self.context.append('</a>') self.context.append('</a>')
else: else: