summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2020-12-07 20:05:13 (GMT)
committerGitHub <noreply@github.com>2020-12-07 20:05:13 (GMT)
commitb63a620014b67a6e63d10783149c41baaf59def8 (patch)
treeaf5619850fd12c65e629a953166319b9dcd6183b /Doc/tools
parentc0afb7fa0ebd1c0e95c0760bbe75a99a8dd12ea6 (diff)
downloadcpython-b63a620014b67a6e63d10783149c41baaf59def8.zip
cpython-b63a620014b67a6e63d10783149c41baaf59def8.tar.gz
cpython-b63a620014b67a6e63d10783149c41baaf59def8.tar.bz2
bpo-42579: Make workaround for various versions of Sphinx more robust (GH-23662)
The solution in gh#python/cpython#13236 is too strict because it effectively requires the use of Sphinx >= 2.0. It is not too difficult to make the same solution more robust so it works with all normal versions of Sphinx.
Diffstat (limited to 'Doc/tools')
-rw-r--r--Doc/tools/extensions/pyspecific.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index 80fbd96..2899439 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -394,7 +394,12 @@ class DeprecatedRemoved(Directive):
translatable=False)
node.append(para)
env = self.state.document.settings.env
- env.get_domain('changeset').note_changeset(node)
+ # deprecated pre-Sphinx-2 method
+ if hasattr(env, 'note_versionchange'):
+ env.note_versionchange('deprecated', version[0], node, self.lineno)
+ # new method
+ else:
+ env.get_domain('changeset').note_changeset(node)
return [node] + messages