@@ -190,15 +190,19 @@ def _execute(self, runtime, env, rm_tmpdir=True, move_outputs="move"):
190
190
os .makedirs (dn )
191
191
stdout_path = absout
192
192
193
- build_job_script = self .builder .build_job_script # type: Callable[[List[str]], Text]
193
+ commands = [Text (x ).encode ('utf-8' ) for x in runtime + self .command_line ]
194
+ job_script_contents = None # type: Text
195
+ builder = getattr (self , "builder" , None ) # type: Builder
196
+ if builder is not None :
197
+ job_script_contents = builder .build_job_script (commands )
194
198
rcode = _job_popen (
195
- [ Text ( x ). encode ( 'utf-8' ) for x in runtime + self . command_line ] ,
199
+ commands ,
196
200
stdin_path = stdin_path ,
197
201
stdout_path = stdout_path ,
198
202
stderr_path = stderr_path ,
199
203
env = env ,
200
204
cwd = self .outdir ,
201
- build_job_script = build_job_script ,
205
+ job_script_contents = job_script_contents ,
202
206
)
203
207
204
208
if self .successCodes and rcode in self .successCodes :
@@ -401,14 +405,9 @@ def _job_popen(
401
405
env , # type: Union[MutableMapping[Text, Text], MutableMapping[str, str]]
402
406
cwd , # type: Text
403
407
job_dir = None , # type: Text
404
- build_job_script = None , # type: Callable[[List[str]], Text]
408
+ job_script_contents = None , # type: Text
405
409
):
406
410
# type: (...) -> int
407
-
408
- job_script_contents = None # type: Text
409
- if build_job_script :
410
- job_script_contents = build_job_script (commands )
411
-
412
411
if not job_script_contents and not FORCE_SHELLED_POPEN :
413
412
414
413
stdin = None # type: Union[IO[Any], int]
0 commit comments