@@ -202,16 +202,32 @@ def _start_process(self, path: str) -> None:
202
202
cmd .extend (self .command_line_args ())
203
203
close_file_descriptors = self .popen_kw .pop ("close_fds" , system () != "Windows" )
204
204
try :
205
- self .process = subprocess .Popen (
206
- cmd ,
207
- env = self .env ,
208
- close_fds = close_file_descriptors ,
209
- stdout = self .log_output ,
210
- stderr = self .log_output ,
211
- stdin = PIPE ,
212
- creationflags = self .creation_flags ,
213
- ** self .popen_kw ,
214
- )
205
+ if system () == "Windows" :
206
+ si = subprocess .STARTUPINFO ()
207
+ si .dwFlags = subprocess .CREATE_NEW_CONSOLE | subprocess .STARTF_USESHOWWINDOW
208
+ si .wShowWindow = subprocess .SW_HIDE
209
+ self .process = subprocess .Popen (
210
+ cmd ,
211
+ env = self .env ,
212
+ close_fds = close_file_descriptors ,
213
+ stdout = self .log_output ,
214
+ stderr = self .log_output ,
215
+ stdin = PIPE ,
216
+ creationflags = self .creation_flags ,
217
+ startupinfo = si ,
218
+ ** self .popen_kw ,
219
+ )
220
+ else :
221
+ self .process = subprocess .Popen (
222
+ cmd ,
223
+ env = self .env ,
224
+ close_fds = close_file_descriptors ,
225
+ stdout = self .log_output ,
226
+ stderr = self .log_output ,
227
+ stdin = PIPE ,
228
+ creationflags = self .creation_flags ,
229
+ ** self .popen_kw ,
230
+ )
215
231
logger .debug (f"Started executable: `{ self ._path } ` in a child process with pid: { self .process .pid } " )
216
232
except TypeError :
217
233
raise
0 commit comments