Skip to content

Commit b63a620

Browse files
authored
bpo-42579: Make workaround for various versions of Sphinx more robust (GH-23662)
The solution in gh##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.
1 parent c0afb7f commit b63a620

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Doc/tools/extensions/pyspecific.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,12 @@ def run(self):
394394
translatable=False)
395395
node.append(para)
396396
env = self.state.document.settings.env
397-
env.get_domain('changeset').note_changeset(node)
397+
# deprecated pre-Sphinx-2 method
398+
if hasattr(env, 'note_versionchange'):
399+
env.note_versionchange('deprecated', version[0], node, self.lineno)
400+
# new method
401+
else:
402+
env.get_domain('changeset').note_changeset(node)
398403
return [node] + messages
399404

400405

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy