From 5b0bb8c1e14a940b88b5048b0a4141e938fc597d Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Sun, 15 Feb 2015 18:01:43 +0900 Subject: [PATCH] Fix bug refs #1722. Circler toctree cause infinite loop. --- sphinx/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/environment.py b/sphinx/environment.py index 535d714cf..676899670 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -1297,7 +1297,7 @@ class BuildEnvironment: parent[child] = p ancestors = [] d = docname - while d in parent: + while d in parent and d not in ancestors: ancestors.append(d) d = parent[d] return ancestors