summaryrefslogtreecommitdiff
path: root/sphinx/ext/autosummary/generate.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-11-30 23:51:16 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-01 00:50:20 +0900
commitd4a199a91de1be4e59b3c77bb566bcc5d9233542 (patch)
tree925c301f6a2beee13a533be94e69095706a6e5ca /sphinx/ext/autosummary/generate.py
parent6f8b3d88d1cd51eb58f078a95a6fa95870fb2be5 (diff)
downloadsphinx-git-d4a199a91de1be4e59b3c77bb566bcc5d9233542.tar.gz
Fix annotations for extensions
Diffstat (limited to 'sphinx/ext/autosummary/generate.py')
-rw-r--r--sphinx/ext/autosummary/generate.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py
index 66fc04d05..163e23e9f 100644
--- a/sphinx/ext/autosummary/generate.py
+++ b/sphinx/ext/autosummary/generate.py
@@ -42,8 +42,7 @@ from sphinx.util.rst import escape as rst_escape
if False:
# For type annotation
- from typing import Any, Callable, Dict, List, Tuple, Type # NOQA
- from jinja2 import BaseLoader # NOQA
+ from typing import Any, Callable, Dict, List, Tuple, Type, Union # NOQA
from sphinx import addnodes # NOQA
from sphinx.builders import Builder # NOQA
from sphinx.environment import BuildEnvironment # NOQA
@@ -117,7 +116,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
template_dirs = [os.path.join(package_dir, 'ext',
'autosummary', 'templates')]
- template_loader = None # type: BaseLoader
+ template_loader = None # type: Union[BuiltinTemplateLoader, FileSystemLoader]
if builder is not None:
# allow the user to override the templates
template_loader = BuiltinTemplateLoader()