Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-16 15:51:46 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-16 15:51:46 +0300
commit30f8640bab786b28e2fbc3a12a4cf212e6f953d1 (patch)
treef5cf23900a7bc509fe970262195995ddc526fda1 /sphinx/environment
parent5460ea103bd91ce910e50e11e05c1e5340c2a9e0 (diff)
parent7c340e1c1c43f173f11efc14feb29cd08cedb995 (diff)
Merge branch '3.x'
Diffstat (limited to 'sphinx/environment')
-rw-r--r--sphinx/environment/adapters/toctree.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/environment/adapters/toctree.py b/sphinx/environment/adapters/toctree.py
index 5b91293a4..2e33cf702 100644
--- a/sphinx/environment/adapters/toctree.py
+++ b/sphinx/environment/adapters/toctree.py
@@ -319,8 +319,10 @@ class TocTree:
toctrees = [] # type: List[Element]
if 'includehidden' not in kwargs:
kwargs['includehidden'] = True
- if 'maxdepth' not in kwargs:
+ if 'maxdepth' not in kwargs or not kwargs['maxdepth']:
kwargs['maxdepth'] = 0
+ else:
+ kwargs['maxdepth'] = int(kwargs['maxdepth'])
kwargs['collapse'] = collapse
for toctreenode in doctree.traverse(addnodes.toctree):
toctree = self.resolve(docname, builder, toctreenode, prune=True, **kwargs)