mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix Sphinx crashes if self referenced toctree found
This commit is contained in:
parent
52c7867d14
commit
5744c53361
1
CHANGES
1
CHANGES
@ -31,6 +31,7 @@ Bugs fixed
|
||||
* #2446: latex(pdf) sets local tables of contents (or more generally topic nodes) in unbreakable boxes, causes overflow at bottom
|
||||
* #2476: Omit MathJax markers if :nowrap: is given
|
||||
* #2465: latex builder fails in case no caption option is provided to toctree directive
|
||||
* Sphinx crashes if self referenced toctree found
|
||||
|
||||
|
||||
Release 1.4.1 (released Apr 12, 2016)
|
||||
|
@ -1911,6 +1911,10 @@ class BuildEnvironment:
|
||||
traversed = set()
|
||||
|
||||
def traverse_toctree(parent, docname):
|
||||
if parent == docname:
|
||||
self.warn(docname, 'self referenced toctree found. Ignored.')
|
||||
return
|
||||
|
||||
# traverse toctree by pre-order
|
||||
yield parent, docname
|
||||
traversed.add(docname)
|
||||
|
Loading…
Reference in New Issue
Block a user