container: Avoid pop-ups on Windows

Avoid window pop-ups on Windows systems, by using the `startupinfo`
argument of `subprocess.run`.
This commit is contained in:
Alex Pyrgiotis 2024-07-02 20:41:58 +03:00
parent 61e04d42ef
commit 27d201a95b
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -67,7 +67,10 @@ class Container(IsolationProvider):
cmd = [runtime, "version", "-f", query]
try:
version = subprocess.run(
cmd, capture_output=True, check=True
cmd,
startupinfo=get_subprocess_startupinfo(),
capture_output=True,
check=True,
).stdout.decode()
except Exception as e:
msg = f"Could not get the version of the {runtime.capitalize()} tool: {e}"