Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions remote_ikernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import logging
import os
import re
import signal
import subprocess
import time
import uuid
Expand All @@ -27,6 +28,10 @@
class pexpect_spawn(PopenSpawn):
def isalive(self):
return self.proc.poll() is None

def sendintr(self):
"""sendintr does not exist on PopenSpawn, use kill instead"""
self.kill(signal.SIGINT)


from tornado.log import LogFormatter
Expand Down Expand Up @@ -520,6 +525,7 @@ def tunnel_connection(self):
# connection info should have the ports being used
tunnel_command = self.tunnel_cmd.format(**self.connection_info)
tunnel = pexpect_spawn(tunnel_command, logfile=self.log)
tunnel.linesep = "\n"
check_password(tunnel)

self.log.info(
Expand Down Expand Up @@ -606,6 +612,7 @@ def _spawn(self, command, timeout=600):
"""
if self.connection is None:
self.connection = pexpect_spawn(command, timeout=timeout, logfile=self.log)
self.connection.linesep = "\n"
else:
self.connection.sendline(command)

Expand Down