From f9ae69d9b003b4839b39b0abc26b6a607b7e08bd Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 26 Mar 2018 02:02:19 +0900 Subject: [PATCH] Drop typing.TYPE_CHECKING --- sphinx/apidoc.py | 4 ++-- sphinx/ext/extlinks.py | 5 ++--- sphinx/ext/githubpages.py | 4 ++-- sphinx/ext/jsmath.py | 6 ++---- sphinx/ext/mathjax.py | 5 ++--- sphinx/quickstart.py | 4 ++-- sphinx/testing/path.py | 4 ++-- 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index f6616e497..dffa4a9ef 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -10,12 +10,12 @@ """ import warnings -from typing import TYPE_CHECKING from sphinx.deprecation import RemovedInSphinx20Warning from sphinx.ext.apidoc import main as _main -if TYPE_CHECKING: +if False: + # For type annotation from typing import Any # NOQA from sphinx.application import Sphinx # NOQA diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py index 53b051c45..29bfe928f 100644 --- a/sphinx/ext/extlinks.py +++ b/sphinx/ext/extlinks.py @@ -24,15 +24,14 @@ :license: BSD, see LICENSE for details. """ -from typing import TYPE_CHECKING - from docutils import nodes, utils from six import iteritems import sphinx from sphinx.util.nodes import split_explicit_title -if TYPE_CHECKING: +if False: + # For type annotation from typing import Any, Dict, List, Tuple # NOQA from docutils.parsers.rst.states import Inliner # NOQA from sphinx.application import Sphinx # NOQA diff --git a/sphinx/ext/githubpages.py b/sphinx/ext/githubpages.py index f97c810f8..bd7061fb7 100644 --- a/sphinx/ext/githubpages.py +++ b/sphinx/ext/githubpages.py @@ -10,11 +10,11 @@ """ import os -from typing import TYPE_CHECKING import sphinx -if TYPE_CHECKING: +if False: + # For type annotation from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA diff --git a/sphinx/ext/jsmath.py b/sphinx/ext/jsmath.py index e523b54c8..b377a6479 100644 --- a/sphinx/ext/jsmath.py +++ b/sphinx/ext/jsmath.py @@ -10,8 +10,6 @@ :license: BSD, see LICENSE for details. """ -from typing import TYPE_CHECKING - from docutils import nodes import sphinx @@ -20,8 +18,8 @@ from sphinx.ext.mathbase import get_node_equation_number from sphinx.ext.mathbase import setup_math as mathbase_setup from sphinx.locale import _ - -if TYPE_CHECKING: +if False: + # For type annotation from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA diff --git a/sphinx/ext/mathjax.py b/sphinx/ext/mathjax.py index 9f8013b2b..e3f7afebe 100644 --- a/sphinx/ext/mathjax.py +++ b/sphinx/ext/mathjax.py @@ -11,8 +11,6 @@ :license: BSD, see LICENSE for details. """ -from typing import TYPE_CHECKING - from docutils import nodes import sphinx @@ -21,7 +19,8 @@ from sphinx.ext.mathbase import get_node_equation_number from sphinx.ext.mathbase import setup_math as mathbase_setup from sphinx.locale import _ -if TYPE_CHECKING: +if False: + # For type annotation from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index dbdfb47c1..8cad0640b 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -10,12 +10,12 @@ """ import warnings -from typing import TYPE_CHECKING from sphinx.cmd.quickstart import main as _main from sphinx.deprecation import RemovedInSphinx20Warning -if TYPE_CHECKING: +if False: + # For type annotation from typing import Any # NOQA diff --git a/sphinx/testing/path.py b/sphinx/testing/path.py index 5f59ad30b..209046246 100644 --- a/sphinx/testing/path.py +++ b/sphinx/testing/path.py @@ -10,11 +10,11 @@ import os import shutil import sys from io import open -from typing import TYPE_CHECKING from six import PY2, text_type -if TYPE_CHECKING: +if False: + # For type annotation from typing import Any, Callable, IO, List # NOQA