MMGenPexpect: add exit_val attr

This commit is contained in:
The MMGen Project 2024-03-10 14:43:33 +00:00
commit 7f0af76b48
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -54,6 +54,7 @@ class MMGenPexpect:
self.skip_ok = False
self.sent_value = None
self.spawn_env = spawn_env
self.exit_val = None
if direct_exec or cfg.direct_exec:
from subprocess import Popen,DEVNULL
@ -95,7 +96,7 @@ class MMGenPexpect:
self.p.sendeof()
self.p.read()
ret = self.p.wait()
if ret != (exit_val or 0) and not cfg.coverage:
if ret != (self.exit_val or exit_val or 0) and not cfg.coverage:
die( 'TestSuiteSpawnedScriptException', f'Spawned script exited with value {ret}' )
if cfg.profile:
return