mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix mypy violations
This commit is contained in:
parent
06da488f6f
commit
c8c82d7cef
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user