diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-19 10:32:46 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-19 10:34:54 +0300 |
commit | 52905782568ec88da2e19814b6a501f0947248f5 (patch) | |
tree | 896d0003fa424a6ba542506452e3bfed502543a4 /sphinx/io.py | |
parent | 841f1c7e766d623d5c071605650bedc834480fd2 (diff) |
Fix sphinx crashes with ImportError on python3.5.1
typing.Type was added since python 3.5.2. So it should be imported
only on type checking.
Diffstat (limited to 'sphinx/io.py')
-rw-r--r-- | sphinx/io.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/io.py b/sphinx/io.py index 18b4f053e..f45d5bf5d 100644 --- a/sphinx/io.py +++ b/sphinx/io.py @@ -10,7 +10,6 @@ import codecs import warnings from typing import Any, List -from typing import Type # for python3.5.1 from docutils import nodes from docutils.core import Publisher @@ -40,6 +39,7 @@ from sphinx.versioning import UIDTransform if False: # For type annotation + from typing import Type # for python3.5.1 from sphinx.application import Sphinx @@ -80,7 +80,7 @@ class SphinxBaseReader(standalone.Reader): self._app = app # hold application object only for compatibility self._env = app.env - def get_transforms(self) -> List[Type[Transform]]: + def get_transforms(self) -> List["Type[Transform]"]: transforms = super().get_transforms() + self.transforms # remove transforms which is not needed for Sphinx |