diff options
author | Jean Kossaifi <jean.kossaifi@gmail.com> | 2021-01-08 15:26:09 +0000 |
---|---|---|
committer | Jean Kossaifi <jean.kossaifi@gmail.com> | 2021-01-09 21:59:53 +0000 |
commit | f77461b4b7f14f93e859fb81d2a08a014997472c (patch) | |
tree | e12e18b602e7c7e0e2de447aa6c01954a351391d /sphinx/environment/adapters/toctree.py | |
parent | d9569a84a28b4720f9adf69ef9778961585ea19a (diff) | |
download | sphinx-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.
Diffstat (limited to 'sphinx/environment/adapters/toctree.py')
-rw-r--r-- | sphinx/environment/adapters/toctree.py | 2 |
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) |