Add compatibility code for different locations of Sphinx NoUri

The location of this exception has changed with Sphinx 3.0
according to the "Deprecated API".
This commit is contained in:
Carsten Grohmann
2022-09-08 21:43:13 +02:00
parent 7c4d21d778
commit f3ac627ca9

View File

@@ -10,7 +10,10 @@ and lists them along with a backlink to the original location.
from docutils import nodes
from sphinx.locale import _
from sphinx.environment import NoUri
try:
from sphinx.errors import NoUri # since Sphinx 3.0
except ImportError:
from sphinx.environment import NoUri # till Sphinx 3.0
from sphinx.util.nodes import set_source_info
from docutils.parsers.rst import Directive