Skip to content

Commit 46db31f

Browse files
committed
Merge from 3.x: PR #4992
Fixes #3529
2 parents 493fe5f + d1a5cd4 commit 46db31f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: spyder/utils/site/sitecustomize.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,21 @@ def execfile(filename, namespace):
195195
HAS_CYTHON = False
196196

197197

198+
#==============================================================================
199+
# Prevent subprocess.Popen calls to create visible console windows on Windows.
200+
# See issue #4932
201+
#==============================================================================
202+
if os.name == 'nt':
203+
import subprocess
204+
creation_flag = 0x08000000 # CREATE_NO_WINDOW
205+
206+
class SubprocessPopen(subprocess.Popen):
207+
def __init__(self, *args, **kwargs):
208+
kwargs['creationflags'] = creation_flag
209+
super(SubprocessPopen, self).__init__(*args, **kwargs)
210+
211+
subprocess.Popen = SubprocessPopen
212+
198213
#==============================================================================
199214
# Importing user's sitecustomize
200215
#==============================================================================
@@ -227,7 +242,6 @@ def _getfilesystemencoding_wrapper():
227242
except:
228243
pass
229244

230-
231245
#==============================================================================
232246
# This prevents a kernel crash with the inline backend in our IPython
233247
# consoles on Linux and Python 3 (Fixes Issue 2257)

0 commit comments

Comments
 (0)