Fix circular import in addnodes.py

Closes #8016
This commit is contained in:
Julien Schueller 2020-07-28 11:44:43 +02:00
parent 2cf3e7cae2
commit cefdb566eb

View File

@ -15,7 +15,6 @@ from docutils import nodes
from docutils.nodes import Element, Node
from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.util import docutils
if False:
# For type annotation
@ -34,6 +33,7 @@ class document(nodes.document):
def set_id(self, node: Element, msgnode: Element = None,
suggested_prefix: str = '') -> str:
from sphinx.util import docutils
if docutils.__version_info__ >= (0, 16):
ret = super().set_id(node, msgnode, suggested_prefix) # type: ignore
else: