Switched to Popen
This commit is contained in:
parent
67fa3a09a5
commit
7542571dfe
1 changed files with 5 additions and 1 deletions
|
@ -46,13 +46,17 @@ with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw:
|
||||||
cmd = (config.get("swash", "swashrun"), "-input", inp.name, *mpi)
|
cmd = (config.get("swash", "swashrun"), "-input", inp.name, *mpi)
|
||||||
log.info(f"Running {cmd}")
|
log.info(f"Running {cmd}")
|
||||||
|
|
||||||
subprocess.run(
|
subprocess.Popen(
|
||||||
cmd,
|
cmd,
|
||||||
cwd=tmpdir,
|
cwd=tmpdir,
|
||||||
stdout=logfile,
|
stdout=logfile,
|
||||||
stderr=logfile,
|
stderr=logfile,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
code = subprocess.wait()
|
||||||
|
if code is not 0:
|
||||||
|
log.error(f"Swash returned error code {code}")
|
||||||
|
|
||||||
log.info(f"Moving swash output to '{out}'")
|
log.info(f"Moving swash output to '{out}'")
|
||||||
shutil.move(tmpdir, out)
|
shutil.move(tmpdir, out)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue