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:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2022-01-01 19:06:24 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2022-01-02 18:35:29 +0300
commit05a898ecb4ff8e654a053a1ba5131715a4514812 (patch)
tree1b9d286602ff2a43c903f861a525c570cb702a6e /sphinx/builders/html/transforms.py
parentdaf57f2488dacc6f3c45edf551fafcc32c404fc9 (diff)
Migrate to Node.findall() from Node.traverse()
Node.traverse() was marked as deprecated since docutils-0.18. Instead of it, Node.findall() has been added as successor of traverse(). This applies a patch to docutils-0.17 or older to be available Node.findall() and use it.
Diffstat (limited to 'sphinx/builders/html/transforms.py')
-rw-r--r--sphinx/builders/html/transforms.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/builders/html/transforms.py b/sphinx/builders/html/transforms.py
index 8c50ce0c4..ea1d69d12 100644
--- a/sphinx/builders/html/transforms.py
+++ b/sphinx/builders/html/transforms.py
@@ -48,7 +48,7 @@ class KeyboardTransform(SphinxPostTransform):
def run(self, **kwargs: Any) -> None:
matcher = NodeMatcher(nodes.literal, classes=["kbd"])
- for node in self.document.traverse(matcher): # type: nodes.literal
+ for node in self.document.findall(matcher): # type: nodes.literal
parts = self.pattern.split(node[-1].astext())
if len(parts) == 1 or self.is_multiwords_key(parts):
continue