Fixed env.note_versionchange() deprecation warning in Sphinx 1.8.
This commit is contained in:
parent
cc4bb110d3
commit
a0ef6a0e22
|
@ -12,6 +12,7 @@ from sphinx import addnodes
|
||||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||||
from sphinx.directives import CodeBlock
|
from sphinx.directives import CodeBlock
|
||||||
from sphinx.domains.std import Cmdoption
|
from sphinx.domains.std import Cmdoption
|
||||||
|
from sphinx.errors import ExtensionError
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
from sphinx.util.console import bold
|
from sphinx.util.console import bold
|
||||||
from sphinx.writers.html import HTMLTranslator
|
from sphinx.writers.html import HTMLTranslator
|
||||||
|
@ -96,7 +97,11 @@ class VersionDirective(Directive):
|
||||||
node['type'] = self.name
|
node['type'] = self.name
|
||||||
if self.content:
|
if self.content:
|
||||||
self.state.nested_parse(self.content, self.content_offset, node)
|
self.state.nested_parse(self.content, self.content_offset, node)
|
||||||
env.note_versionchange(node['type'], node['version'], node, self.lineno)
|
try:
|
||||||
|
env.get_domain('changeset').note_changeset(node)
|
||||||
|
except ExtensionError:
|
||||||
|
# Sphinx < 1.8: Domain 'changeset' is not registered
|
||||||
|
env.note_versionchange(node['type'], node['version'], node, self.lineno)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue