Skip to content

Commit 130fad7

Browse files
committed
Simplifying value checks for RuntimeContext.on_error in parallel_steps() and WorkflowJob.job().
There isn't a need to use getdefault() when querying the value because a default is already set when RuntimeContext is constructed. The checked condition additionally applies to on_error==kill, so the logic can be simplified to on_error!=continue.
1 parent eafaff4 commit 130fad7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cwltool/workflow_job.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def parallel_steps(
135135
while rc.completed < rc.total:
136136
made_progress = False
137137
for index, step in enumerate(steps):
138-
if getdefault(runtimeContext.on_error, "stop") == "stop" and rc.processStatus not in (
138+
if runtimeContext.on_error != "continue" and rc.processStatus not in (
139139
"success",
140140
"skipped",
141141
):
@@ -144,9 +144,7 @@ def parallel_steps(
144144
continue
145145
try:
146146
for j in step:
147-
if getdefault(
148-
runtimeContext.on_error, "stop"
149-
) == "stop" and rc.processStatus not in ("success", "skipped"):
147+
if runtimeContext.on_error != "continue" and rc.processStatus not in ("success", "skipped"):
150148
break
151149
if j is not None:
152150
made_progress = True
@@ -808,7 +806,7 @@ def job(
808806

809807
for step in self.steps:
810808
if (
811-
getdefault(runtimeContext.on_error, "stop") == "stop"
809+
runtimeContext.on_error != "continue"
812810
and self.processStatus != "success"
813811
):
814812
break
@@ -825,7 +823,7 @@ def job(
825823
try:
826824
for newjob in step.iterable:
827825
if (
828-
getdefault(runtimeContext.on_error, "stop") == "stop"
826+
runtimeContext.on_error != "continue"
829827
and self.processStatus != "success"
830828
):
831829
break

0 commit comments

Comments
 (0)