Skip to content

Commit

Permalink
Avoid setting unsuported parameter for subprocess.Popen on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: aiordache <anca.iordache@docker.com>
  • Loading branch information
aiordache committed Dec 18, 2020
1 parent 4757eea commit c9f0ce2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docker/transport/sshconn.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,17 @@ def connect(self, **kwargs):
port,
'docker system dial-stdio'
]

preexec_func = None
if not constants.IS_WINDOWS_PLATFORM:
preexec_func = lambda: signal.signal(signal.SIGINT, signal.SIG_IGN))

self.proc = subprocess.Popen(
' '.join(args),
shell=True,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
preexec_fn=lambda: signal.signal(signal.SIGINT, signal.SIG_IGN))
preexec_fn=preexec_func)

def _write(self, data):
if not self.proc or self.proc.stdin.closed:
Expand Down

0 comments on commit c9f0ce2

Please sign in to comment.