diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-03-14 02:07:05 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-03-17 17:42:47 +0900 |
commit | bee5f45a682f36b7182cdf71c33f08f3bb40d1f9 (patch) | |
tree | 1fd0ff2a20b080237f08f71885e9b52b5970161b | |
parent | a95af4c195cb49802daf8aa9160ee036af812239 (diff) | |
download | sphinx-git-bee5f45a682f36b7182cdf71c33f08f3bb40d1f9.tar.gz |
Fix #6172: AttributeError is raised for old styled index nodes
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | sphinx/util/compat.py | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -32,6 +32,7 @@ Bugs fixed classes attribute refers missing citation (refs: #6147) * #2155: Support ``code`` directive * C++, fix parsing of braced initializers. +* #6172: AttributeError is raised for old styled index nodes Testing -------- diff --git a/sphinx/util/compat.py b/sphinx/util/compat.py index 1567bad9e..5d8cbb3db 100644 --- a/sphinx/util/compat.py +++ b/sphinx/util/compat.py @@ -58,12 +58,12 @@ class IndexEntriesMigrator(SphinxTransform): def apply(self, **kwargs): # type: (Any) -> None for node in self.document.traverse(addnodes.index): - for entries in node['entries']: + for i, entries in enumerate(node['entries']): if len(entries) == 4: source, line = get_source_line(node) warnings.warn('An old styled index node found: %r at (%s:%s)' % (node, source, line), RemovedInSphinx40Warning) - entries.extend([None]) + node['entries'][i] = entries + (None,) def setup(app): |