summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-06-19 14:55:33 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-08-12 07:47:31 +0200
commitd90555ef0603935529837e490d5acc8436297c56 (patch)
tree8c8817a5d0b2ab5371ccd035bb984022963015d1
parent0b24dfdd12f4ca3ef5efa0cfaad3fc14f5b3fbf1 (diff)
docs: parser_yaml.py: fix backward compatibility with old docutils
As reported by Akira, older docutils versions are not compatible with the way some Sphinx versions send tab_width. Add a code to address it. Reported-by: Akira Yokosawa <akiyks@gmail.com> Closes: https://lore.kernel.org/linux-doc/598b2cb7-2fd7-4388-96ba-2ddf0ab55d2a@gmail.com/ Tested-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rwxr-xr-xDocumentation/sphinx/parser_yaml.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/sphinx/parser_yaml.py b/Documentation/sphinx/parser_yaml.py
index 8288e2ff7c7c..1602b31f448e 100755
--- a/Documentation/sphinx/parser_yaml.py
+++ b/Documentation/sphinx/parser_yaml.py
@@ -77,6 +77,10 @@ class YamlParser(Parser):
result.append(line, document.current_source, lineoffset)
+ # Fix backward compatibility with docutils < 0.17.1
+ if "tab_width" not in vars(document.settings):
+ document.settings.tab_width = 8
+
rst_parser = RSTParser()
rst_parser.parse('\n'.join(result), document)