mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fixes #870: silence spurious KeyErrors when removing documents.
This commit is contained in:
parent
01167a8af5
commit
87c50b6605
2
CHANGES
2
CHANGES
@ -46,6 +46,8 @@ Release 1.1.3 (in development)
|
||||
|
||||
* #876: Fix quickstart test under Python 3.
|
||||
|
||||
* #870: Fix spurious KeyErrors when removing documents.
|
||||
|
||||
|
||||
Release 1.1.2 (Nov 1, 2011) -- 1.1.1 is a silly version number anyway!
|
||||
======================================================================
|
||||
|
@ -1164,7 +1164,12 @@ class BuildEnvironment:
|
||||
|
||||
def get_toc_for(self, docname, builder):
|
||||
"""Return a TOC nodetree -- for use on the same page only!"""
|
||||
toc = self.tocs[docname].deepcopy()
|
||||
try:
|
||||
toc = self.tocs[docname].deepcopy()
|
||||
except KeyError:
|
||||
# the document does not exist anymore: return a dummy node that
|
||||
# renders to nothing
|
||||
return nodes.paragraph()
|
||||
self.process_only_nodes(toc, builder, docname)
|
||||
for node in toc.traverse(nodes.reference):
|
||||
node['refuri'] = node['anchorname'] or '#'
|
||||
|
Loading…
Reference in New Issue
Block a user