aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-06-11 03:40:45 -0500
committerFrederick Muriuki Muriithi2025-06-11 03:40:45 -0500
commit2fae0c6811fe53494e0cfbffc93b15450ecf5423 (patch)
treea8600166adc6241ccfc40f8a48308d7061e139e6
parentade102b0b9983c4f63b2f819a9884919ce00e405 (diff)
downloadgn-libs-2fae0c6811fe53494e0cfbffc93b15450ecf5423.tar.gz
Fix code errors caught by type-checker.HEADmain
-rw-r--r--gn_libs/jobs/jobs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gn_libs/jobs/jobs.py b/gn_libs/jobs/jobs.py
index 8d77139..ec1c3a8 100644
--- a/gn_libs/jobs/jobs.py
+++ b/gn_libs/jobs/jobs.py
@@ -92,7 +92,7 @@ def initialise_job(# pylint: disable=[too-many-arguments, too-many-positional-ar
command: list,
job_type: str,
extra_meta: Optional[dict] = None,
- expiry_seconds: Optional[int] = _DEFAULT_EXPIRY_SECONDS_
+ expiry_seconds: int = _DEFAULT_EXPIRY_SECONDS_
) -> dict:
"""Initialise the job and put the details in a SQLite3 database."""
if extra_meta is None:
@@ -115,7 +115,7 @@ def initialise_job(# pylint: disable=[too-many-arguments, too-many-positional-ar
def output_file(jobid: uuid.UUID, outdir: Path, stream: str) -> Path:
"""Compute the path for the file where the launcher's `stream` output goes"""
assert stream in ("stdout", "stderr"), f"Invalid stream '{stream}'"
- return f"{outdir}/launcher_job_{jobid}.{stream}"
+ return outdir.joinpath(f"launcher_job_{jobid}.{stream}")
stdout_filename = partial(output_file, stream="stdout")
@@ -146,10 +146,10 @@ def launch_job(
os.mkdir(error_dir)
job_id = str(the_job["job_id"])
- with (open(stderr_filename(jobid=job_id, outdir=error_dir),
+ with (open(stderr_filename(jobid=the_job["job_id"], outdir=error_dir),
"w",
encoding="utf-8") as stderrfile,
- open(stdout_filename(jobid=job_id, outdir=error_dir),
+ open(stdout_filename(jobid=the_job["job_id"], outdir=error_dir),
"w",
encoding="utf-8") as stdoutfile):
subprocess.Popen( # pylint: disable=[consider-using-with]