Skip to content

Commit

Permalink
sweep: #7575 fix(Workflow): prevent circular import in WorkflowReader
Browse files Browse the repository at this point in the history
  • Loading branch information
andresailer authored and web-flow committed Apr 18, 2024
1 parent f23906f commit 02fe111
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/DIRAC/Core/Workflow/Workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,17 +396,20 @@ 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)
return handler.root


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)
Expand Down

0 comments on commit 02fe111

Please sign in to comment.