From f3ac627ca99a00384bfb5c66a8eb13a7d50d7536 Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Thu, 8 Sep 2022 21:43:13 +0200 Subject: [PATCH] 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". --- docs/sphinx/availability.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/availability.py b/docs/sphinx/availability.py index 4ee8b578..bfbe352f 100644 --- a/docs/sphinx/availability.py +++ b/docs/sphinx/availability.py @@ -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