[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <064bac2f462c13f56154891d8f3fb788db94f325.1747730982.git.mchehab+huawei@kernel.org>
Date: Tue, 20 May 2025 10:55:47 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Jonathan Corbet <corbet@....net>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Kees Cook <kees@...nel.org>,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] docs: kerneldoc.py: add try/except blocks for kernel-doc class errors
Replicate the same behavior as what's done with kernel-doc.pl:
continue building docs even when there are exceptions.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
Documentation/sphinx/kerneldoc.py | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
index 314479718a01..4de667d4d95b 100644
--- a/Documentation/sphinx/kerneldoc.py
+++ b/Documentation/sphinx/kerneldoc.py
@@ -278,14 +278,27 @@ class KernelDocDirective(Directive):
node = nodes.section()
- kfiles.parse(**self.parse_args)
- filenames = self.parse_args["file_list"]
+ try:
+ kfiles.parse(**self.parse_args)
+ filenames = self.parse_args["file_list"]
+ msgs = kfiles.msg(**self.msg_args, filenames=filenames)
- for filename, out in kfiles.msg(**self.msg_args, filenames=filenames):
+ except Exception as e: # pylint: disable=W0703
+ logger.warning("kernel-doc '%s' processing failed with: %s" %
+ (cmd_str(cmd), str(e)))
+
+ for filename, out in msgs:
if self.verbose >= 1:
print(cmd_str(cmd))
- ret = self.parse_msg(filename, node, out, cmd)
+ try:
+ ret = self.parse_msg(filename, node, out, cmd)
+
+ except Exception as e: # pylint: disable=W0703
+ logger.warning("kernel-doc '%s' processing failed with: %s" %
+ (cmd_str(cmd), str(e)))
+ return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
+
if ret:
return ret
--
2.49.0
Powered by blists - more mailing lists