Skip to content

Commit ad57e17

Browse files
committed
fix import of internal functions
1 parent b9554c9 commit ad57e17

File tree

1 file changed

+7
-4
lines changed
  • python_workflow_definition/src/python_workflow_definition/cwl

1 file changed

+7
-4
lines changed

python_workflow_definition/src/python_workflow_definition/cwl/__main__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55

66

77
def load_function(file_name, funct):
8-
spec = importlib.util.spec_from_file_location("workflow", file_name)
9-
module = importlib.util.module_from_spec(spec)
10-
sys.modules["workflow"] = module
11-
spec.loader.exec_module(module)
8+
if file_name.split("/")[-1] != "python_workflow_definition.py":
9+
spec = importlib.util.spec_from_file_location("workflow", file_name)
10+
module = importlib.util.module_from_spec(spec)
11+
sys.modules["workflow"] = module
12+
spec.loader.exec_module(module)
13+
else:
14+
module = importlib.import_module("python_workflow_definition.shared")
1215
return getattr(module, funct.split(".")[-1])
1316

1417

0 commit comments

Comments
 (0)