avoid initial runs to show acmetool not found errors

This commit is contained in:
holger krekel
2025-04-09 16:09:17 +02:00
committed by missytake
parent 2a89be8209
commit 3cc9bc3ceb

View File

@@ -1,10 +1,13 @@
from subprocess import CalledProcessError, check_output
from subprocess import DEVNULL, CalledProcessError, check_output
def shell(command, fail_ok=False):
print(f"$ {command}")
args = dict(shell=True)
if fail_ok:
args["stderr"] = DEVNULL
try:
return check_output(command, shell=True).decode().rstrip()
return check_output(command, **args).decode().rstrip()
except CalledProcessError:
if not fail_ok:
raise