From 2a59fbcdbeb9a623173c465b0f46335df86a05fb Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Fri, 7 Aug 2020 15:38:28 -0600 Subject: [PATCH] Make the toc.circular suppress_warnings flag apply to self referenced toctrees Fixes https://github.com/sphinx-doc/sphinx/issues/7410#issuecomment-670678193. --- sphinx/environment/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index cf3364494b7..8ce9fa365a9 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -594,7 +594,9 @@ def collect_relations(self) -> Dict[str, List[str]]: def traverse_toctree(parent: str, docname: str) -> Iterator[Tuple[str, str]]: if parent == docname: - logger.warning(__('self referenced toctree found. Ignored.'), location=docname) + logger.warning(__('self referenced toctree found. Ignored.'), + location=docname, type='toc', + subtype='circular') return # traverse toctree by pre-order