summaryrefslogtreecommitdiff
path: root/sphinx/ext/autosummary/__init__.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-03-03 12:19:09 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-03-03 23:17:34 +0900
commit554199d30e418f72f215fae65924b47249d2544c (patch)
treefd952e21a8f4e9dabf91c5e3731dea3712ade006 /sphinx/ext/autosummary/__init__.py
parent28b1aceefedbb9c3a12d6ba7c712df8ad5e98db8 (diff)
downloadsphinx-git-554199d30e418f72f215fae65924b47249d2544c.tar.gz
Upgrade to mypy-0.5
Diffstat (limited to 'sphinx/ext/autosummary/__init__.py')
-rw-r--r--sphinx/ext/autosummary/__init__.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py
index 7bf5ad5b8..7e29bf2ef 100644
--- a/sphinx/ext/autosummary/__init__.py
+++ b/sphinx/ext/autosummary/__init__.py
@@ -76,7 +76,7 @@ from sphinx.ext.autodoc import Options
if False:
# For type annotation
- from typing import Any, Tuple, Type, Union # NOQA
+ from typing import Any, Dict, List, Tuple, Type, Union # NOQA
from docutils.utils import Inliner # NOQA
from sphinx.application import Sphinx # NOQA
from sphinx.environment import BuildEnvironment # NOQA
@@ -546,8 +546,7 @@ def _import_by_name(name):
# -- :autolink: (smart default role) -------------------------------------------
-def autolink_role(typ, rawtext, etext, lineno, inliner,
- options={}, content=[]):
+def autolink_role(typ, rawtext, etext, lineno, inliner, options={}, content=[]):
# type: (unicode, unicode, unicode, int, Inliner, Dict, List[unicode]) -> Tuple[List[nodes.Node], List[nodes.Node]] # NOQA
"""Smart linking role.
@@ -555,6 +554,7 @@ def autolink_role(typ, rawtext, etext, lineno, inliner,
otherwise expands to '*text*'.
"""
env = inliner.document.settings.env
+ r = None # type: Tuple[List[nodes.Node], List[nodes.Node]]
r = env.get_domain('py').role('obj')(
'obj', rawtext, etext, lineno, inliner, options, content)
pnode = r[0][0]
@@ -563,9 +563,9 @@ def autolink_role(typ, rawtext, etext, lineno, inliner,
try:
name, obj, parent, modname = import_by_name(pnode['reftarget'], prefixes)
except ImportError:
- content = pnode[0]
- r[0][0] = nodes.emphasis(rawtext, content[0].astext(), # type: ignore
- classes=content['classes']) # type: ignore
+ content_node = pnode[0]
+ r[0][0] = nodes.emphasis(rawtext, content_node[0].astext(),
+ classes=content_node['classes'])
return r
@@ -581,7 +581,7 @@ def get_rst_suffix(app):
return parser_class.supported
suffix = None # type: unicode
- for suffix in app.config.source_suffix: # type: ignore
+ for suffix in app.config.source_suffix:
if 'restructuredtext' in get_supported_format(suffix):
return suffix