Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: sphinx: avoid using the deprecated node.set_class()

Docutils emits a deprecation warning when the set_class() element method is
used; that warning disappears into the ether, but it also causes a crash
with docutils 0.19.

Avoid the deprecated function and just append directly to the "classes"
attribute like the documentation says instead.

Reported-by: Akira Yokosawa <akiyks@gmail.com>
Tested-by: Akira Yokosawa <akiyks@gmail.com>
Closes: https://lore.kernel.org/de7bae91-3200-481f-9db2-c0dc382c91dd@gmail.com/
Fixes: d6d1df92c25f ("docs: automarkup: Mark up undocumented entities too")
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

+1 -1
+1 -1
Documentation/sphinx/automarkup.py
··· 240 240 # mark it as a broken xref 241 241 # 242 242 if contnode: 243 - contnode.set_class("broken_xref") 243 + contnode['classes'].append("broken_xref") 244 244 return contnode 245 245 246 246 #