Skip to content

Commit

Permalink
Fix build failure for Docutils 0.18.0 (#10597)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Jun 25, 2022
1 parent 4b48233 commit 5a24fec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit 5a24fec

Please sign in to comment.