diff --git a/src/psij/executors/batch/batch_scheduler_executor.py b/src/psij/executors/batch/batch_scheduler_executor.py index f784717fd..ca1688a2f 100644 --- a/src/psij/executors/batch/batch_scheduler_executor.py +++ b/src/psij/executors/batch/batch_scheduler_executor.py @@ -510,7 +510,8 @@ def _clean_submit_script(self, job: Job) -> None: assert isinstance(self.config, BatchSchedulerExecutorConfig) if not self.config.keep_files: submit_file_path = self.work_directory / (job.id + '.job') - submit_file_path.unlink() + if submit_file_path.exists(): + submit_file_path.unlink() except Exception as ex: logger.warning('Job %s: failed clean submit script: %s', job.id, ex)