summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Kossaifi <jean.kossaifi@gmail.com>2021-01-08 15:26:09 +0000
committerJean Kossaifi <jean.kossaifi@gmail.com>2021-01-09 21:59:53 +0000
commitf77461b4b7f14f93e859fb81d2a08a014997472c (patch)
treee12e18b602e7c7e0e2de447aa6c01954a351391d
parentd9569a84a28b4720f9adf69ef9778961585ea19a (diff)
downloadsphinx-git-f77461b4b7f14f93e859fb81d2a08a014997472c.tar.gz
Cast maxdepth to int in toctree
When specifying the max-depth for the toctree in theme.conf that isn't automatically cast to int, causing a hard to locate error.
-rw-r--r--sphinx/environment/adapters/toctree.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sphinx/environment/adapters/toctree.py b/sphinx/environment/adapters/toctree.py
index 182eb956f..a765e8fe9 100644
--- a/sphinx/environment/adapters/toctree.py
+++ b/sphinx/environment/adapters/toctree.py
@@ -322,6 +322,8 @@ class TocTree:
kwargs['includehidden'] = True
if 'maxdepth' not in kwargs:
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)