From 532cc3cad9add9543ca908bffa87229dc3a28935 Mon Sep 17 00:00:00 2001 From: Huang-Ming Huang Date: Fri, 12 Jun 2026 11:20:59 -0500 Subject: [PATCH] Fix launcher option replacement guard --- tests/TestHarness/launcher.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/TestHarness/launcher.py b/tests/TestHarness/launcher.py index e66f0ea64a..cfe1a4f37c 100644 --- a/tests/TestHarness/launcher.py +++ b/tests/TestHarness/launcher.py @@ -16,6 +16,10 @@ block_dir = 'blocks' +def _is_command_option(token): + """Return whether a command-line token is an option name rather than an option value.""" + return token.startswith('--') + class EnhancedEncoder(json.JSONEncoder): def default(self, o): if is_dataclass(o): @@ -575,7 +579,7 @@ def construct_command_line(self, instance: nodeDefinition): if '-' in arg and arg not in repeatable: if arg in sysdcmd: i = sysdcmd.index(arg) - if sysdcmd[i+1] != '-': + if i + 1 < len(sysdcmd) and not _is_command_option(sysdcmd[i+1]): sysdcmd.pop(i+1) sysdcmd.pop(i) sysdcmd.extend(specificList)