Skip to content

Commit 8e27563

Browse files
committed
bpo-40851: Don't set wShowWindow if startupinfo has STARTF_USESHOWWINDOW
1 parent 01ece63 commit 8e27563

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/subprocess.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,8 +1401,9 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
14011401
close_fds = False
14021402

14031403
if shell:
1404-
startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
1405-
startupinfo.wShowWindow = _winapi.SW_HIDE
1404+
if not startupinfo.dwFlags & _winapi.STARTF_USESHOWWINDOW:
1405+
startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
1406+
startupinfo.wShowWindow = _winapi.SW_HIDE
14061407
comspec = os.environ.get("COMSPEC", "cmd.exe")
14071408
args = '{} /c "{}"'.format (comspec, args)
14081409

0 commit comments

Comments
 (0)