Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build failure for Docutils 0.18.0 #10597

Merged
merged 2 commits into from Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -17,6 +17,8 @@ Bugs fixed
----------

* #10594: HTML Theme: field term colons are doubled if using Docutils 0.18+
* #10596: Build failure if Docutils version is 0.18 (not 0.18.1) due
to missing ``Node.findall()``

Testing
--------
Expand Down
4 changes: 2 additions & 2 deletions sphinx/util/docutils.py
Expand Up @@ -550,9 +550,9 @@ def unknown_visit(self, node: Node) -> None:


# Node.findall() is a new interface to traverse a doctree since docutils-0.18.
# This applies a patch docutils-0.17 or older to be available Node.findall()
# This applies a patch to docutils up to 0.18 inclusive to provide Node.findall()
# method to use it from our codebase.
if docutils.__version_info__ < (0, 18):
if docutils.__version_info__ <= (0, 18):
def findall(self, *args, **kwargs):
return iter(self.traverse(*args, **kwargs))

Expand Down