Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 20, 2023
1 parent fe97f8e commit 0e348ae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pydra/engine/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ def make_spec(self, cmd=None, arg=None):
spec = self.psij.JobSpec()
spec.executable = cmd
spec.arguments = arg

return spec

def make_job(self, spec, attributes):
Expand Down Expand Up @@ -960,16 +960,18 @@ async def exec_psij(self, runnable, rerun=False):

spec.stdout_path = os.path.join(cache_dir, "demo.stdout")
spec.stderr_path = os.path.join(cache_dir, "demo.stderr")

job = self.make_job(spec, None)
jex.submit(job)
job.wait()

if os.path.getsize(spec.stderr_path) > 0:
with open(spec.stderr_path, "r") as stderr_file:
stderr_contents = stderr_file.read()
raise Exception(f"stderr_path '{spec.stderr_path}' is not empty. Contents:\n{stderr_contents}")

raise Exception(
f"stderr_path '{spec.stderr_path}' is not empty. Contents:\n{stderr_contents}"
)

return

def close(self):
Expand Down

0 comments on commit 0e348ae

Please sign in to comment.