Skip to content
Permalink
Browse files
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.
  • Loading branch information
mcepl committed Dec 7, 2020
1 parent c0afb7f commit b63a620014b67a6e63d10783149c41baaf59def8
Showing 1 changed file with 6 additions and 1 deletion.
@@ -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


0 comments on commit b63a620

Please sign in to comment.