Skip to content

Commit b92527f

Browse files
committed
cleanups
1 parent 7746701 commit b92527f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

cwltool/errors.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ class WorkflowKillSwitch(Exception):
1818
"""When processStatus != "success" and on-error=kill, raise this exception."""
1919

2020
def __init__(self, job_id, rcode):
21+
"""Record the job identifier and the error code."""
2122
self.job_id = job_id
2223
self.rcode = rcode
2324

2425
def __str__(self):
25-
return f'[job {self.job_id}] activated kill switch with return code {self.rcode}'
26+
"""Represent this exception as a string."""
27+
return f"[job {self.job_id}] activated kill switch with return code {self.rcode}"

cwltool/job.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@ def monitor_kill_switch() -> None:
547547
nonlocal ks_tm
548548
if kill_switch.is_set():
549549
_logger.error("[job %s] terminating by kill switch", self.name)
550-
if sproc.stdin: sproc.stdin.close()
550+
if sproc.stdin:
551+
sproc.stdin.close()
551552
sproc.terminate()
552553
else:
553554
ks_tm = Timer(interval=1, function=monitor_kill_switch)

cwltool/task_queue.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import threading
88
from typing import Callable, Optional
99

10-
from .loghandler import _logger
1110
from .errors import WorkflowKillSwitch
11+
from .loghandler import _logger
1212

1313

1414
class TaskQueue:

0 commit comments

Comments
 (0)