khh
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
This commit is contained in:
18
SYS/tasks.py
18
SYS/tasks.py
@@ -102,6 +102,23 @@ def _run_task(args, parser) -> int:
|
||||
'command': command,
|
||||
'cwd': args.cwd or os.getcwd(),
|
||||
})
|
||||
|
||||
popen_kwargs = {}
|
||||
if os.name == 'nt':
|
||||
# Avoid flashing a console window when spawning console-subsystem executables.
|
||||
flags = 0
|
||||
try:
|
||||
flags |= int(getattr(subprocess, 'CREATE_NO_WINDOW', 0x08000000))
|
||||
except Exception:
|
||||
flags |= 0x08000000
|
||||
popen_kwargs['creationflags'] = flags
|
||||
try:
|
||||
si = subprocess.STARTUPINFO()
|
||||
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
si.wShowWindow = subprocess.SW_HIDE
|
||||
popen_kwargs['startupinfo'] = si
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
process = subprocess.Popen(
|
||||
command,
|
||||
@@ -112,6 +129,7 @@ def _run_task(args, parser) -> int:
|
||||
text=True,
|
||||
bufsize=1,
|
||||
universal_newlines=True,
|
||||
**popen_kwargs,
|
||||
)
|
||||
except FileNotFoundError as exc:
|
||||
notifier('downlow-task-event', {
|
||||
|
||||
Reference in New Issue
Block a user