From 1f94e7e30a17967c1bb8eb9f329030daf9feb512 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Tue, 23 Jun 2026 11:19:01 +0200 Subject: [PATCH] scripts: ssl_session_reset_check: return exception if parsing of preprocessor directive fails If next(lines) return StopIteration while processing a preprocessor directive then that's an expected failure that should be reported to the user. Signed-off-by: Valerio Setti --- scripts/mbedtls_framework/ssl_session_reset_check.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mbedtls_framework/ssl_session_reset_check.py b/scripts/mbedtls_framework/ssl_session_reset_check.py index bc64ecbb8..f4369af4d 100644 --- a/scripts/mbedtls_framework/ssl_session_reset_check.py +++ b/scripts/mbedtls_framework/ssl_session_reset_check.py @@ -183,7 +183,8 @@ class CStruct: try: argument = argument[:-1] + ' ' + next(lines)[1] except StopIteration: - break + raise Exception(f'Unexpected end of the structure reached while ' + ' parsing a C preprocessor directive') return argument def _structure_fields(self,