Skip to content
Merged
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
9 changes: 6 additions & 3 deletions ipykernel/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from IPython.core.getipython import get_ipython
import debugpy

# Required for backwards compatiblity
ROUTING_ID = getattr(zmq, 'ROUTING_ID', None) or zmq.IDENTITY

class DebugpyMessageQueue:

HEADER = 'Content-Length: '
Expand Down Expand Up @@ -119,7 +122,7 @@ def _forward_event(self, msg):

def _send_request(self, msg):
if self.routing_id is None:
self.routing_id = self.debugpy_stream.socket.getsockopt(zmq.ROUTING_ID)
self.routing_id = self.debugpy_stream.socket.getsockopt(ROUTING_ID)
content = jsonapi.dumps(msg)
content_length = str(len(content))
buf = (DebugpyMessageQueue.HEADER + content_length + DebugpyMessageQueue.SEPARATOR).encode('ascii')
Expand Down Expand Up @@ -166,7 +169,7 @@ def get_host_port(self):

def connect_tcp_socket(self):
self.debugpy_stream.socket.connect(self._get_endpoint())
self.routing_id = self.debugpy_stream.socket.getsockopt(zmq.ROUTING_ID)
self.routing_id = self.debugpy_stream.socket.getsockopt(ROUTING_ID)

def disconnect_tcp_socket(self):
self.debugpy_stream.socket.disconnect(self._get_endpoint())
Expand Down Expand Up @@ -260,7 +263,7 @@ def start(self):
'silent': True
}
self.session.send(self.shell_socket, 'execute_request', content,
None, (self.shell_socket.getsockopt(zmq.ROUTING_ID)))
None, (self.shell_socket.getsockopt(ROUTING_ID)))

ident, msg = self.session.recv(self.shell_socket, mode=0)
self.debugpy_initialized = msg['content']['status'] == 'ok'
Expand Down