File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 2323import six
2424from six .moves import xrange , zip
2525
26+ import platform
2627import sys
2728import itertools
2829import contextlib
3435# Process creation flag for subprocess to prevent it raising a terminal
3536# window. See for example:
3637# https://stackoverflow.com/questions/24130623/using-python-subprocess-popen-cant-prevent-exe-stopped-working-prompt
37- CREATE_NO_WINDOW = 0x08000000
38+ if platform .system () == 'Windows' :
39+ CREATE_NO_WINDOW = 0x08000000
40+ subprocess_creation_flags = CREATE_NO_WINDOW
41+ else :
42+ # Apparently None won't work here
43+ subprocess_creation_flags = 0
3844
3945# Other potential writing methods:
4046# * http://pymedia.org/
@@ -195,7 +201,7 @@ def _run(self):
195201 self ._proc = subprocess .Popen (command , shell = False ,
196202 stdout = output , stderr = output ,
197203 stdin = subprocess .PIPE ,
198- creationflags = CREATE_NO_WINDOW )
204+ creationflags = subprocess_creation_flags )
199205
200206 def finish (self ):
201207 'Finish any processing for writing the movie.'
@@ -258,7 +264,7 @@ def isAvailable(cls):
258264 shell = False ,
259265 stdout = subprocess .PIPE ,
260266 stderr = subprocess .PIPE ,
261- creationflags = CREATE_NO_WINDOW )
267+ creationflags = subprocess_creation_flags )
262268 p .communicate ()
263269 return True
264270 except OSError :
You can’t perform that action at this time.
0 commit comments