Exit with errorlevel set

This commit is contained in:
Fierelier 2024-01-19 21:47:52 +01:00
parent b751765b0f
commit 5ea0a6a766

View File

@ -66,7 +66,7 @@ def runReg(cmd,check = True):
else:
cmdStr = " ".join(cmd)
cmdProc = subprocess.Popen(["cmd.exe"],stdin=subprocess.PIPE,stdout=subprocess.DEVNULL)
cmdProc.stdin.write((cmdStr + "\nexit\n").encode("utf-8"))
cmdProc.stdin.write((cmdStr + "\nexit %errorlevel%\n").encode("utf-8"))
cmdProc.stdin.flush()
rtn = cmdProc.wait()
if rtn != 0: raise Exception
@ -265,4 +265,4 @@ def applyRegmap(rp):
for path in target["regmap"]:
if rp.startswith(path):
return rp.replace(path,target["regmap"][path],1)
return rp
return rp