diff options
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 2ce5c0315..84ef2a9f9 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 available or not if is_html5_writer_available(): from sphinx.writers.html5 import HTML5Translator @@ -302,7 +307,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: |