Skip to content

Commit

Permalink
fix(Workflow): prevent circular import in WorkflowReader
Browse files Browse the repository at this point in the history
  • Loading branch information
andresailer committed Apr 17, 2024
1 parent d591ed4 commit 291bca3
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 291bca3

Please sign in to comment.