Skip to content

Commit 721a2da

Browse files
authored
use os._exit(exitStatus) instead of haging sys.exit(exitStatus) (#154)
1 parent 8de10ea commit 721a2da

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

shared.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def simulationAcceptsFlag(f, checkOutput=True, cwd=None, isWin=False):
9191
else:
9292
subprocess.check_output("./HelloWorld %s" % f, shell=True, stderr=subprocess.STDOUT, cwd=cwd)
9393

94-
if (not os.path.exists("HelloWorld_res.mat")):
95-
print("Result file HelloWorld_res.mat WAS NOT generated running: ./HelloWorld with flags [%s]" % f)
94+
#if (not os.path.exists("HelloWorld_res.mat")):
95+
# print("Result file HelloWorld_res.mat WAS NOT generated running: ./HelloWorld with flags [%s]" % f)
9696
if (not checkOutput) or os.path.exists("HelloWorld_res.mat"):
9797
return True
9898
except subprocess.CalledProcessError as e:

testmodel.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ def writeResult():
4444

4545
def writeResultAndExit(exitStatus):
4646
writeResult()
47-
sys.exit(exitStatus)
47+
print("Calling exit ...")
48+
sys.stdout.flush()
49+
os._exit(exitStatus)
50+
# calling sys.exit will hang in lock.acquire()
51+
# sys.exit(exitStatus)
4852

4953
def sendExpressionTimeout(omc, cmd, timeout):
5054
with open(errFile, 'a+') as fp:

0 commit comments

Comments
 (0)