From 5f1d2cc48a878348fe9df118963759803afad8f2 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Sat, 13 Nov 2021 06:32:51 +0100 Subject: [PATCH] getMaxIndex hide unimportant errors --- api/opusnt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/opusnt.py b/api/opusnt.py index 0904397..080f995 100644 --- a/api/opusnt.py +++ b/api/opusnt.py @@ -172,13 +172,18 @@ def getVersion(hkey,SOFTWARE): target["version"] = versionData def getMaxIndex(): + subprocess.run([ + "wimlib-imagex","info", + target["path"],"1" + ],check=True,stdout=subprocess.DEVNULL) + ind = 2 while True: try: subprocess.run([ "wimlib-imagex","info", target["path"],str(ind) - ],check=True) + ],check=True,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL) ind += 1 except Exception as e: target["maxIndex"] = ind - 1