From 291bca3612afeda8b3f30e872a6b490ad61f5682 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Wed, 17 Apr 2024 17:19:59 +0200 Subject: [PATCH] fix(Workflow): prevent circular import in WorkflowReader --- src/DIRAC/Core/Workflow/Workflow.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/DIRAC/Core/Workflow/Workflow.py b/src/DIRAC/Core/Workflow/Workflow.py index a658b69d365..3a3f6bffd14 100755 --- a/src/DIRAC/Core/Workflow/Workflow.py +++ b/src/DIRAC/Core/Workflow/Workflow.py @@ -396,10 +396,10 @@ def execute(self): return S_OK(step_result) -from DIRAC.Core.Workflow.WorkflowReader import WorkflowXMLHandler - - def fromXMLString(xml_string, obj=None): + # prevent circular import in WorkflowReader + from DIRAC.Core.Workflow.WorkflowReader import WorkflowXMLHandler + # KGG !!! We need to reset Workflow if it exists handler = WorkflowXMLHandler(obj) xml.sax.parseString(xml_string, handler) @@ -407,6 +407,9 @@ def fromXMLString(xml_string, obj=None): def fromXMLFile(xml_file, obj=None): + # prevent circular import in WorkflowReader + from DIRAC.Core.Workflow.WorkflowReader import WorkflowXMLHandler + # KGG !!! We need to reset Workflow if it exists handler = WorkflowXMLHandler(obj) xml.sax.parse(xml_file, handler)