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:
authorJean-François B <2589111+jfbu@users.noreply.github.com>2022-06-25 23:15:04 +0300
committerGitHub <noreply@github.com>2022-06-25 23:15:04 +0300
commit5a24fec8de10323de7b46f4d3606765ffc246dd9 (patch)
treee57f181eebcd99d7b0d87506e9b5b8dc38f8a676
parent4b482334a28d0706ba4bd68d51be9c041c135798 (diff)
Fix build failure for Docutils 0.18.0 (#10597)
-rw-r--r--CHANGES2
-rw-r--r--sphinx/util/docutils.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 547533a9b..99a2ab9bf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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
--------
diff --git a/sphinx/util/docutils.py b/sphinx/util/docutils.py
index e1fd78096..b2944ec28 100644
--- a/sphinx/util/docutils.py
+++ b/sphinx/util/docutils.py
@@ -550,9 +550,9 @@ class SphinxTranslator(nodes.NodeVisitor):
# 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))