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 23
23
import six
24
24
from six .moves import xrange , zip
25
25
26
+ import platform
26
27
import sys
27
28
import itertools
28
29
import contextlib
34
35
# Process creation flag for subprocess to prevent it raising a terminal
35
36
# window. See for example:
36
37
# 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
38
44
39
45
# Other potential writing methods:
40
46
# * http://pymedia.org/
@@ -195,7 +201,7 @@ def _run(self):
195
201
self ._proc = subprocess .Popen (command , shell = False ,
196
202
stdout = output , stderr = output ,
197
203
stdin = subprocess .PIPE ,
198
- creationflags = CREATE_NO_WINDOW )
204
+ creationflags = subprocess_creation_flags )
199
205
200
206
def finish (self ):
201
207
'Finish any processing for writing the movie.'
@@ -258,7 +264,7 @@ def isAvailable(cls):
258
264
shell = False ,
259
265
stdout = subprocess .PIPE ,
260
266
stderr = subprocess .PIPE ,
261
- creationflags = CREATE_NO_WINDOW )
267
+ creationflags = subprocess_creation_flags )
262
268
p .communicate ()
263
269
return True
264
270
except OSError :
You can’t perform that action at this time.
0 commit comments