summaryrefslogtreecommitdiffstats
path: root/Doc/tools/extensions
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-06-23 07:58:45 (GMT)
committerGitHub <noreply@github.com>2023-06-23 07:58:45 (GMT)
commita72683ba8e0337650cc490dbe593a5e46aba60cb (patch)
tree1c0f1d6d70ae0dd283556c0970d761da7a7727c4 /Doc/tools/extensions
parent6a80664ef1200008d5beb1584e03d779ef30cc58 (diff)
downloadcpython-a72683ba8e0337650cc490dbe593a5e46aba60cb.zip
cpython-a72683ba8e0337650cc490dbe593a5e46aba60cb.tar.gz
cpython-a72683ba8e0337650cc490dbe593a5e46aba60cb.tar.bz2
Docs: Avoid a DeprecationWarning in `pyspecific.py` when running with Sphinx >=6.1 (#105886)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Diffstat (limited to 'Doc/tools/extensions')
-rw-r--r--Doc/tools/extensions/pyspecific.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index 8a2eb07..795aeed 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -14,29 +14,27 @@ import io
from os import getenv, path
from time import asctime
from pprint import pformat
+
+from docutils import nodes, utils
from docutils.io import StringOutput
from docutils.parsers.rst import Directive
from docutils.utils import new_document
-
-from docutils import nodes, utils
-
from sphinx import addnodes
from sphinx.builders import Builder
-try:
- from sphinx.errors import NoUri
-except ImportError:
- from sphinx.environment import NoUri
+from sphinx.domains.python import PyFunction, PyMethod
+from sphinx.errors import NoUri
from sphinx.locale import _ as sphinx_gettext
-from sphinx.util import status_iterator, logging
+from sphinx.util import logging
from sphinx.util.docutils import SphinxDirective
from sphinx.util.nodes import split_explicit_title
from sphinx.writers.text import TextWriter, TextTranslator
try:
- from sphinx.domains.python import PyFunction, PyMethod
+ # Sphinx 6+
+ from sphinx.util.display import status_iterator
except ImportError:
- from sphinx.domains.python import PyClassmember as PyMethod
- from sphinx.domains.python import PyModulelevel as PyFunction
+ # Deprecated in Sphinx 6.1, will be removed in Sphinx 8
+ from sphinx.util import status_iterator
ISSUE_URI = 'https://bugs.python.org/issue?@action=redirect&bpo=%s'