diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-02-14 16:57:20 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-02-14 16:57:38 +0300 |
commit | a073e17537c2aacaac305feadea58d4473ec97f4 (patch) | |
tree | b3ef3d0ad15132c4e5ae5064f9c7b678fbcad120 /sphinx/jinja2glue.py | |
parent | 91807f882dafbd6185b8d88c0bf4cbf97cf520fb (diff) |
Use typing.TYPE_CHECKING for typehints
Diffstat (limited to 'sphinx/jinja2glue.py')
-rw-r--r-- | sphinx/jinja2glue.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sphinx/jinja2glue.py b/sphinx/jinja2glue.py index cc935d577..4dac0210a 100644 --- a/sphinx/jinja2glue.py +++ b/sphinx/jinja2glue.py @@ -11,7 +11,7 @@ from os import path from pprint import pformat -from typing import Any, Callable, Iterator, Tuple # NOQA +from typing import TYPE_CHECKING, Any, Callable, Iterator, Tuple # NOQA from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, \ contextfunction @@ -22,8 +22,7 @@ from six import string_types from sphinx.application import TemplateBridge from sphinx.util.osutil import mtimes_of_files -if False: - # For type annotation +if TYPE_CHECKING: from typing import Any, Callable, Dict, List, Iterator, Tuple # NOQA from jinja2.environment import Environment # NOQA from sphinx.builders import Builder # NOQA |