Skip to content

Commit

Permalink
Merge pull request #7575 from andresailer/8_fixCircularImport
Browse files Browse the repository at this point in the history
[8.0] fix(Workflow): prevent circular import in WorkflowReader
  • Loading branch information
fstagni authored Apr 18, 2024
2 parents d591ed4 + 291bca3 commit 6e51ed7
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 6e51ed7

Please sign in to comment.