mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Python API Executor now waits until process has finished before returning from run_simulation(...) routine even if output=False
This commit is contained in:
parent
4451b71f36
commit
c58c5639de
1 changed files with 6 additions and 4 deletions
|
|
@ -30,14 +30,16 @@ class Executor(object):
|
|||
stdout=subprocess.PIPE)
|
||||
|
||||
# Capture and re-print OpenMC output in real-time
|
||||
while (True and output):
|
||||
line = p.stdout.readline()
|
||||
print(line, end='')
|
||||
|
||||
while True:
|
||||
# If OpenMC is finished, break loop
|
||||
line = p.stdout.readline()
|
||||
if not line and p.poll() != None:
|
||||
break
|
||||
|
||||
# If user requested output, print to screen
|
||||
if output:
|
||||
print(line, end='')
|
||||
|
||||
# Return the returncode (integer, zero if no problems encountered)
|
||||
return p.returncode
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue