Skip to content

Commit 9e480fb

Browse files
committed
Don't clean up submit file if it doesn't exist, which is the case when
attaching a job to a native job.
1 parent 331d446 commit 9e480fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/psij/executors/batch/batch_scheduler_executor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ def _clean_submit_script(self, job: Job) -> None:
510510
assert isinstance(self.config, BatchSchedulerExecutorConfig)
511511
if not self.config.keep_files:
512512
submit_file_path = self.work_directory / (job.id + '.job')
513-
submit_file_path.unlink()
513+
if submit_file_path.exists():
514+
submit_file_path.unlink()
514515
except Exception as ex:
515516
logger.warning('Job %s: failed clean submit script: %s', job.id, ex)
516517

0 commit comments

Comments
 (0)