From 7cb68054bf19d48a5c340cb2f53e05ddb50f11b1 Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Wed, 20 Nov 2024 17:43:20 +0100 Subject: [PATCH] Fix existence check of config files Signed-off-by: Gabor Mezei --- scripts/mbedtls_framework/config_common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/mbedtls_framework/config_common.py b/scripts/mbedtls_framework/config_common.py index 570eba2fd..0e2f48877 100644 --- a/scripts/mbedtls_framework/config_common.py +++ b/scripts/mbedtls_framework/config_common.py @@ -228,9 +228,10 @@ class ConfigFile(metaclass=ABCMeta): if os.path.lexists(candidate): filename = candidate break - else: - raise FileNotFoundError(f'{name} configuration file not found: ' - f'{filename if filename else default_path}') + + if not os.path.lexists(filename): + raise FileNotFoundError(f'{name} configuration file not found: ' + f'{filename if filename else default_path}') self.filename = filename self.templates = []