diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-07-13 23:29:38 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-07-13 23:46:17 +0900 |
commit | 0c48a28ad7216ee064b0db564745d749c049bfd5 (patch) | |
tree | 2bc2f13992c930c00bd3b60ea3e2c27c31e659cd /sphinx/builders/html.py | |
parent | 0bc530f1b7b3303e0f53e42010b629d67e79b835 (diff) | |
download | sphinx-git-0c48a28ad7216ee064b0db564745d749c049bfd5.tar.gz |
Fix type annotation for python 3.5.1
Diffstat (limited to 'sphinx/builders/html.py')
-rw-r--r-- | sphinx/builders/html.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 1a7054bdc..ea005204c 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -15,7 +15,7 @@ import sys import warnings from hashlib import md5 from os import path -from typing import Any, Dict, IO, Iterable, Iterator, List, Set, Type, Tuple +from typing import Any, Dict, IO, Iterable, Iterator, List, Set, Tuple from docutils import nodes from docutils.core import publish_parts @@ -48,6 +48,11 @@ from sphinx.util.osutil import os_path, relative_uri, ensuredir, movefile, copyf from sphinx.util.tags import Tags from sphinx.writers.html import HTMLWriter, HTMLTranslator +if False: + # For type annotation + from typing import Type # for python3.5.1 + + # HTML5 Writer is avialable or not if is_html5_writer_available(): from sphinx.writers.html5 import HTML5Translator @@ -331,7 +336,7 @@ class StandaloneHTMLBuilder(Builder): self.script_files.append(JavaScript(filename, **kwargs)) @property - def default_translator_class(self) -> Type[nodes.NodeVisitor]: # type: ignore + def default_translator_class(self) -> "Type[nodes.NodeVisitor]": # type: ignore if not html5_ready or self.config.html4_writer: return HTMLTranslator else: |