Skip to content

Commit

Permalink
ignore SIGINT in paramiko tunnel subprocesses
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Nov 7, 2012
1 parent fb4a45e commit f109ece
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions IPython/external/ssh/tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from __future__ import print_function

import os,sys, atexit
import signal
import socket
from multiprocessing import Process
from getpass import getpass, getuser
Expand Down Expand Up @@ -331,9 +332,10 @@ def _paramiko_tunnel(lport, rport, server, remoteip, keyfile=None, password=None
except Exception as e:
print ('*** Failed to connect to %s:%d: %r' % (server, port, e))
sys.exit(1)

# print ('Now forwarding port %d to %s:%d ...' % (lport, server, rport))


# Don't let SIGINT kill the tunnel subprocess
signal.signal(signal.SIGINT, signal.SIG_IGN)

try:
forward_tunnel(lport, remoteip, rport, client.get_transport())
except KeyboardInterrupt:
Expand Down

0 comments on commit f109ece

Please sign in to comment.