File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ def read_frames(
146
146
stdin = subprocess .PIPE ,
147
147
stdout = subprocess .PIPE ,
148
148
stderr = subprocess .PIPE ,
149
- ** _popen_kwargs ()
149
+ ** _popen_kwargs (prevent_sigint = True )
150
150
)
151
151
152
152
log_catcher = LogCatcher (p .stderr )
@@ -437,7 +437,7 @@ def write_frames(
437
437
stdin = subprocess .PIPE ,
438
438
stdout = subprocess .PIPE ,
439
439
stderr = None ,
440
- ** _popen_kwargs ()
440
+ ** _popen_kwargs (prevent_sigint = True )
441
441
)
442
442
443
443
# Note that directing stderr to a pipe on windows will cause ffmpeg
Original file line number Diff line number Diff line change @@ -52,20 +52,21 @@ def get_ffmpeg_exe():
52
52
)
53
53
54
54
55
- def _popen_kwargs ():
55
+ def _popen_kwargs (prevent_sigint = False ):
56
56
startupinfo = None
57
57
preexec_fn = None
58
58
creationflags = 0
59
59
if sys .platform .startswith ("win" ):
60
60
# Stops executable from flashing on Windows (see #22)
61
61
startupinfo = subprocess .STARTUPINFO ()
62
62
startupinfo .dwFlags |= subprocess .STARTF_USESHOWWINDOW
63
- # Prevent propagation of sigint (see #4)
64
- creationflags = 0x00000200
65
- else :
63
+ if prevent_sigint :
66
64
# Prevent propagation of sigint (see #4)
67
65
# https://stackoverflow.com/questions/5045771
68
- preexec_fn = os .setpgrp # the _pre_exec does not seem to work
66
+ if sys .platform .startswith ("win" ):
67
+ creationflags = 0x00000200
68
+ else :
69
+ preexec_fn = os .setpgrp # the _pre_exec does not seem to work
69
70
return {
70
71
"startupinfo" : startupinfo ,
71
72
"creationflags" : creationflags ,
You can’t perform that action at this time.
0 commit comments