From 88ddd5d475c9165d7cd619e0f16f3227e05685bd Mon Sep 17 00:00:00 2001 From: Per Held Date: Tue, 4 Nov 2025 14:40:39 +0100 Subject: [PATCH] Arm backend: Fix mypy warning in runner_utils.py Add a return None if elf_path is not set. Signed-off-by: per.held@arm.com Change-Id: Ib03c31cb2a29ce4635d3294121037904012d2fde --- backends/arm/test/runner_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backends/arm/test/runner_utils.py b/backends/arm/test/runner_utils.py index f0a1c540e3d..2c76af1b779 100644 --- a/backends/arm/test/runner_utils.py +++ b/backends/arm/test/runner_utils.py @@ -714,7 +714,9 @@ def assert_elf_path_exists(elf_path): ) -def get_elf_path(target_board: str, use_portable_ops: bool = False): +def get_elf_path(target_board: str, use_portable_ops: bool = False) -> str: + elf_path = "" + if target_board not in VALID_TARGET: raise ValueError(f"Unsupported target: {target_board}") @@ -729,14 +731,13 @@ def get_elf_path(target_board: str, use_portable_ops: bool = False): f"arm_semihosting_executor_runner_{portable_ops_str}{target_board}", "arm_executor_runner", ) - assert_elf_path_exists(elf_path) elif target_board == "vkml_emulation_layer": elf_path = os.path.join( f"arm_test/arm_executor_runner_{portable_ops_str}vkml", "executor_runner", ) - assert_elf_path_exists(elf_path) + assert_elf_path_exists(elf_path) return elf_path