summaryrefslogtreecommitdiff
path: root/sphinx/domains/python.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-01-29 10:43:31 +0100
committerGeorg Brandl <georg@python.org>2012-01-29 10:43:31 +0100
commit516715945d11e4f99624369489581354702cdff2 (patch)
tree1ca173fc3a4fa96ef4cbc9956773597351b48232 /sphinx/domains/python.py
parentdbe2066cd457d95e1253a9d208dd3c19a566d380 (diff)
downloadsphinx-516715945d11e4f99624369489581354702cdff2.tar.gz
Closes #864: Fix crash with some settings of :confval:`modindex_common_prefix`.
Diffstat (limited to 'sphinx/domains/python.py')
-rw-r--r--sphinx/domains/python.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
index 3f74e58c..38f521dc 100644
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -525,7 +525,8 @@ class PythonModuleIndex(Index):
# it's a submodule
if prev_modname == package:
# first submodule - make parent a group head
- entries[-1][1] = 1
+ if entries:
+ entries[-1][1] = 1
elif not prev_modname.startswith(package):
# submodule without parent in list, add dummy entry
entries.append([stripped + package, 1, '', '', '', '', ''])