summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-03-14 02:07:05 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-03-17 17:42:47 +0900
commitbee5f45a682f36b7182cdf71c33f08f3bb40d1f9 (patch)
tree1fd0ff2a20b080237f08f71885e9b52b5970161b
parenta95af4c195cb49802daf8aa9160ee036af812239 (diff)
downloadsphinx-git-bee5f45a682f36b7182cdf71c33f08f3bb40d1f9.tar.gz
Fix #6172: AttributeError is raised for old styled index nodes
-rw-r--r--CHANGES1
-rw-r--r--sphinx/util/compat.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index b48ee5e75..d15580368 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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):