From 1ccb61fe18ddc1fbb498ee90f182c44066aefb36 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Thu, 12 Oct 2017 13:08:24 +0300 Subject: [PATCH] Make dbapi_extension.py compatible with Sphinx 1.6 In Sphinx commit 1a821b89e9952fc2, the deprecated make_admonition() function was removed. This commit updates the code to use the modern API instead. --- doc/src/tools/lib/dbapi_extension.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/src/tools/lib/dbapi_extension.py b/doc/src/tools/lib/dbapi_extension.py index cb3fec47..7ab656fa 100755 --- a/doc/src/tools/lib/dbapi_extension.py +++ b/doc/src/tools/lib/dbapi_extension.py @@ -12,7 +12,7 @@ from docutils import nodes from sphinx.locale import _ -from sphinx.util.compat import Directive, make_admonition +from docutils.parsers.rst import Directive class extension_node(nodes.Admonition, nodes.Element): pass @@ -29,12 +29,11 @@ class Extension(Directive): option_spec = {} def run(self): - nodes = make_admonition(extension_node, - self.name, [_('DB API extension')], self.options, - self.content, self.lineno, self.content_offset, - self.block_text, self.state, self.state_machine) - nodes[0]['classes'].append('dbapi-extension') - return nodes + node = extension_node('\n'.join(self.content)) + node += nodes.title(_('DB API extension'), _('DB API extension')) + self.state.nested_parse(self.content, self.content_offset, node) + node['classes'].append('dbapi-extension') + return [node] def visit_extension_node(self, node):