()
| 252 | |
| 253 | |
| 254 | def subprocess_window_options() -> dict[str, Any]: |
| 255 | if sys.platform != "win32": |
| 256 | return {} |
| 257 | startupinfo = subprocess.STARTUPINFO() |
| 258 | startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW |
| 259 | startupinfo.wShowWindow = 0 |
| 260 | return { |
| 261 | "creationflags": getattr(subprocess, "CREATE_NO_WINDOW", 0), |
| 262 | "startupinfo": startupinfo, |
| 263 | } |
| 264 | |
| 265 | |
| 266 | def run_command(args: list[str], timeout: int = 20) -> subprocess.CompletedProcess[str]: |