replace CreateProcess to subprocess.Popen

This commit is contained in:
Benedek Racz 2020-04-18 15:28:40 +02:00
parent c8977d8460
commit 8f7008d72f

View File

@ -386,10 +386,12 @@ class SpawnBase:
logger.info(f'Console starter command:{commandLine}') logger.info(f'Console starter command:{commandLine}')
# start the console-reader # start the console-reader
_, _, self.console_pid, __otid = win32process.CreateProcess( import subprocess
None, commandLine, None, None, False, win32process.CREATE_NEW_CONSOLE, environ, startupinfo = subprocess.STARTUPINFO()
self.cwd, si startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
)
proc = subprocess.Popen(commandLine,creationflags=subprocess.CREATE_NEW_CONSOLE, startupinfo=startupinfo)
self.console_pid = proc.pid
def get_console_process(self, force=False): def get_console_process(self, force=False):
if force or self.console_process is None: if force or self.console_process is None: