File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,21 @@ def execfile(filename, namespace):
195
195
HAS_CYTHON = False
196
196
197
197
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
+
198
213
#==============================================================================
199
214
# Importing user's sitecustomize
200
215
#==============================================================================
@@ -227,7 +242,6 @@ def _getfilesystemencoding_wrapper():
227
242
except :
228
243
pass
229
244
230
-
231
245
#==============================================================================
232
246
# This prevents a kernel crash with the inline backend in our IPython
233
247
# consoles on Linux and Python 3 (Fixes Issue 2257)
You can’t perform that action at this time.
0 commit comments