From 8f7008d72f73d53107c777bff660eaaa4e15e4c7 Mon Sep 17 00:00:00 2001 From: Benedek Racz Date: Sat, 18 Apr 2020 15:28:40 +0200 Subject: [PATCH] replace CreateProcess to subprocess.Popen --- wexpect/host.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wexpect/host.py b/wexpect/host.py index f512269..1d803c6 100644 --- a/wexpect/host.py +++ b/wexpect/host.py @@ -386,10 +386,12 @@ class SpawnBase: logger.info(f'Console starter command:{commandLine}') # start the console-reader - _, _, self.console_pid, __otid = win32process.CreateProcess( - None, commandLine, None, None, False, win32process.CREATE_NEW_CONSOLE, environ, - self.cwd, si - ) + import subprocess + startupinfo = subprocess.STARTUPINFO() + 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): if force or self.console_process is None: