From 02fe111baa0bed368ea95dde0e52fe9584702807 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Thu, 18 Apr 2024 09:39:30 +0200 Subject: [PATCH] sweep: #7575 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)