Skip to content

Commit

Permalink
bpo-42579: Make workaround for various versions of Sphinx more robust (
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
mcepl authored Dec 7, 2020
1 parent c0afb7f commit b63a620
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Doc/tools/extensions/pyspecific.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,12 @@ def run(self):
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


Expand Down

0 comments on commit b63a620

Please sign in to comment.