From cfcdedd137e5749341e59993eb89145958de79f0 Mon Sep 17 00:00:00 2001 From: Juraj Smiesko Date: Fri, 11 Aug 2023 14:57:22 +0200 Subject: [PATCH 1/2] Loop through configurables with dict.fromkeys() --- k4FWCore/scripts/k4run | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/k4FWCore/scripts/k4run b/k4FWCore/scripts/k4run index 9fa272d2..39399732 100755 --- a/k4FWCore/scripts/k4run +++ b/k4FWCore/scripts/k4run @@ -27,8 +27,7 @@ def load_file(file): def add_arguments(parser, app_mgr): - configurables = app_mgr.allConfigurables.values() - for conf in configurables: + for conf in dict.fromkeys(app_mgr.allConfigurables.values()): # skip public tools and the applicationmgr itself if "ToolSvc" in conf.name() or "ApplicationMgr" in conf.name(): continue From ed4388c0c741d5b15f4405b2f3355297f13a4f76 Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Tue, 22 Aug 2023 11:01:47 +0200 Subject: [PATCH 2/2] Update k4FWCore/scripts/k4run Co-authored-by: Leonhard Reichenbach --- k4FWCore/scripts/k4run | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/k4FWCore/scripts/k4run b/k4FWCore/scripts/k4run index 39399732..7af939ee 100755 --- a/k4FWCore/scripts/k4run +++ b/k4FWCore/scripts/k4run @@ -27,7 +27,9 @@ def load_file(file): def add_arguments(parser, app_mgr): - for conf in dict.fromkeys(app_mgr.allConfigurables.values()): + # length increases when properties of an algorithm with tools are inspected + # see https://github.com/key4hep/k4FWCore/pull/138 + for conf in tuple(app_mgr.allConfigurables.values()): # skip public tools and the applicationmgr itself if "ToolSvc" in conf.name() or "ApplicationMgr" in conf.name(): continue