mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #6172: AttributeError is raised for old styled index nodes
This commit is contained in:
parent
a95af4c195
commit
bee5f45a68
1
CHANGES
1
CHANGES
@ -32,6 +32,7 @@ Bugs fixed
|
|||||||
classes attribute refers missing citation (refs: #6147)
|
classes attribute refers missing citation (refs: #6147)
|
||||||
* #2155: Support ``code`` directive
|
* #2155: Support ``code`` directive
|
||||||
* C++, fix parsing of braced initializers.
|
* C++, fix parsing of braced initializers.
|
||||||
|
* #6172: AttributeError is raised for old styled index nodes
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -58,12 +58,12 @@ class IndexEntriesMigrator(SphinxTransform):
|
|||||||
def apply(self, **kwargs):
|
def apply(self, **kwargs):
|
||||||
# type: (Any) -> None
|
# type: (Any) -> None
|
||||||
for node in self.document.traverse(addnodes.index):
|
for node in self.document.traverse(addnodes.index):
|
||||||
for entries in node['entries']:
|
for i, entries in enumerate(node['entries']):
|
||||||
if len(entries) == 4:
|
if len(entries) == 4:
|
||||||
source, line = get_source_line(node)
|
source, line = get_source_line(node)
|
||||||
warnings.warn('An old styled index node found: %r at (%s:%s)' %
|
warnings.warn('An old styled index node found: %r at (%s:%s)' %
|
||||||
(node, source, line), RemovedInSphinx40Warning)
|
(node, source, line), RemovedInSphinx40Warning)
|
||||||
entries.extend([None])
|
node['entries'][i] = entries + (None,)
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
|
Loading…
Reference in New Issue
Block a user