Skip to content

Commit

Permalink
docs: Keep up with the location of NoUri
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Jonathan Corbet committed Jan 24, 2020
1 parent 6535a39 commit bcac386
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Documentation/sphinx/automarkup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
Expand Down

0 comments on commit bcac386

Please sign in to comment.