summaryrefslogtreecommitdiffstats
path: root/Documentation/sphinx
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2020-01-22 16:06:28 -0700
committerJonathan Corbet <corbet@lwn.net>2020-01-24 09:47:05 -0700
commitbcac386f3d3940354e76ab6309e4279134848424 (patch)
tree97734f6a5fefd94ace846bab15fad3f932b5109d /Documentation/sphinx
parent6535a39ffa88d24e7b277737e6a7405181f68710 (diff)
downloadlinux-bcac386f3d3940354e76ab6309e4279134848424.tar.gz
linux-bcac386f3d3940354e76ab6309e4279134848424.tar.bz2
linux-bcac386f3d3940354e76ab6309e4279134848424.zip
docs: Keep up with the location of NoUri
Sphinx 2.1 moved sphinx.environment.NoUri into sphinx.errors; that produced this warning in the docs build: /usr/lib/python3.7/site-packages/sphinx/registry.py:473: RemovedInSphinx30Warning: sphinx.environment.NoUri is deprecated. Grab NoUri from the right place and make the warning go away. That symbol was only added to sphinx.errors in 2.1, so we must still import it from the old location when running in older versions. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/sphinx')
-rw-r--r--Documentation/sphinx/automarkup.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
index 5b6119ff69f4..b18236370742 100644
--- a/Documentation/sphinx/automarkup.py
+++ b/Documentation/sphinx/automarkup.py
@@ -5,8 +5,13 @@
# has been done.
#
from docutils import nodes
+import sphinx
from sphinx import addnodes
-from sphinx.environment import NoUri
+if sphinx.version_info[0] < 2 or \
+ sphinx.version_info[0] == 2 and sphinx.version_info[1] < 1:
+ from sphinx.environment import NoUri
+else:
+ from sphinx.errors import NoUri
import re
#