* [PATCH] scripts/spdxcheck: add friendly error message for missing ply module
@ 2026-08-27 5:36 3237174131
2026-08-27 5:44 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: 3237174131 @ 2026-08-27 5:36 UTC (permalink / raw)
To: linux-kernel; +Cc: tglx, gregkh
[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]
From: Xia Zhoxin <3237174131@qq.com>
Subject: [PATCH] scripts/spdxcheck: add friendly error message for missing ply module
To: linux-kernel@vger.kernel.org
Cc: tglx@kernel.org, gregkh@linuxfoundation.org
The spdxcheck.py script requires the 'ply' Python module, but when
it is missing, the script crashes with a raw ImportError traceback.
This is especially problematic in CI environments where the error
is not immediately obvious.
Add a friendly error message that tells the user exactly what is
needed and how to install it.
Signed-off-by: Xia Zhoxin <3237174131@qq.com>
---
scripts/spdxcheck.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -5,7 +5,13 @@
from argparse import ArgumentParser
-from ply import lex, yacc
+try:
+ from ply import lex, yacc
+except ImportError as e:
+ import sys
+ sys.stderr.write('Error: %s\n' % e)
+ sys.stderr.write('Please install the ply module (e.g., pip install ply)\n')
+ sys.exit(1)
import locale
import traceback
import fnmatch
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] scripts/spdxcheck: add friendly error message for missing ply module
2026-08-27 5:36 [PATCH] scripts/spdxcheck: add friendly error message for missing ply module 3237174131
@ 2026-08-27 5:44 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-08-27 5:44 UTC (permalink / raw)
To: 3237174131; +Cc: linux-kernel, tglx
On Wed, Aug 26, 2026 at 10:35:43PM -0700, 3237174131@qq.com wrote:
> From: Xia Zhoxin <3237174131@qq.com>
> Subject: [PATCH] scripts/spdxcheck: add friendly error message for missing ply module
> To: linux-kernel@vger.kernel.org
> Cc: tglx@kernel.org, gregkh@linuxfoundation.org
This shouldn't be in the body of the email.
Try using a tool like `b4` to send patches out, it's designed to make
this type of thing "just work".
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-27 5:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 5:36 [PATCH] scripts/spdxcheck: add friendly error message for missing ply module 3237174131
2026-08-27 5:44 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®