Skip to content

Commit bcac386

Browse files
author
Jonathan Corbet
committed
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 <[email protected]>
1 parent 6535a39 commit bcac386

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Documentation/sphinx/automarkup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
# has been done.
66
#
77
from docutils import nodes
8+
import sphinx
89
from sphinx import addnodes
9-
from sphinx.environment import NoUri
10+
if sphinx.version_info[0] < 2 or \
11+
sphinx.version_info[0] == 2 and sphinx.version_info[1] < 1:
12+
from sphinx.environment import NoUri
13+
else:
14+
from sphinx.errors import NoUri
1015
import re
1116

1217
#

0 commit comments

Comments
 (0)