From a073e17537c2aacaac305feadea58d4473ec97f4 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 14 Feb 2018 22:57:20 +0900 Subject: Use typing.TYPE_CHECKING for typehints --- sphinx/ext/linkcode.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sphinx/ext/linkcode.py') diff --git a/sphinx/ext/linkcode.py b/sphinx/ext/linkcode.py index af45f32fa..8467bffd5 100644 --- a/sphinx/ext/linkcode.py +++ b/sphinx/ext/linkcode.py @@ -9,6 +9,8 @@ :license: BSD, see LICENSE for details. """ +from typing import TYPE_CHECKING + from docutils import nodes import sphinx @@ -16,8 +18,7 @@ from sphinx import addnodes from sphinx.errors import SphinxError from sphinx.locale import _ -if False: - # For type annotation +if TYPE_CHECKING: from typing import Any, Dict, Set # NOQA from sphinx.application import Sphinx # NOQA -- cgit v1.2.1