Skip to content

Commit 331d446

Browse files
authored
Merge pull request #391 from ExaWorks/added_check_for_job_bound
Added a simple check in `JobExecutor.submit()` to test if a job's
2 parents 887b02a + b36d9fe commit 331d446

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/psij/job_executor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def _check_job(self, job: Job) -> JobSpec:
105105
raise TypeError('environment key "%s" has non-string value (%s)'
106106
% (k, type(v).__name__))
107107

108+
if job.executor is not None:
109+
raise InvalidJobException('Job is already associated with an executor')
108110
job.executor = self
109111
return spec
110112

0 commit comments

Comments
 (0)