Skip to content

Commit

Permalink
fix buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
bolliger32 committed Jun 19, 2019
1 parent 00d322a commit 10edc50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/python/clawutil/runclaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,17 @@ def runclaw(xclawcmd=None, outdir=None, overwrite=True, restart=None,

cmd_split = shlex.split(cmd)
if isinstance(xclawout,str):
xclawout = open(xclawout,'w', encoding='utf-8')
xclawout = open(xclawout,'w', encoding='utf-8',
buffering=1)
if isinstance(xclawerr,str):
xclawerr = open(xclawerr,'w', encoding='utf-8')
xclawerr = open(xclawerr,'w', encoding='utf-8',
buffering=1)
try:
p = subprocess.run(cmd_split,
cwd=outdir,
stdout=xclawout,
stderr=xclawerr,
encoding='utf-8',
bufsize=1,
check=True)
except subprocess.CalledProcessError as cpe:
raise ClawExeError('error', cpe.returncode, cpe.cmd,
Expand Down

0 comments on commit 10edc50

Please sign in to comment.