Skip to content

Commit 168548e

Browse files
committed
Stop using deprecated recv_multipart when using in-process socket.
Found while working on napari/napari#3314 This should be the right fix, as BackgroundSocket is used only in inprocess kernel, and while in general iopub_socket looks like it can be `Any()` for this particular class we have a trait saying iopub_socket has to be a BackgroundSocket The recv in jupyter_client side (which is called by the line I change here) is def recv(self, socket, mode=zmq.NOBLOCK, content=True, copy=True): """Receive and unpack a message. Parameters ---------- socket : ZMQStream or Socket The socket or stream to use in receiving. Returns ------- [idents], msg [idents] is a list of idents and msg is a nested message dict of same format as self.msg returns. """ if isinstance(socket, ZMQStream): socket = socket.socket try: msg_list = socket.recv_multipart(mode, copy=copy) # this will trigger deprecation warning except zmq.ZMQError as e: ... And I doubt we want to make that aware of background socket.
1 parent cf2d56e commit 168548e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ipykernel/inprocess/ipkernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _redirected_io(self):
131131
def _io_dispatch(self, change):
132132
""" Called when a message is sent to the IO socket.
133133
"""
134-
ident, msg = self.session.recv(self.iopub_socket, copy=False)
134+
ident, msg = self.session.recv(self.iopub_socket.io_thread.socket, copy=False)
135135
for frontend in self.frontends:
136136
frontend.iopub_channel.call_handlers(msg)
137137

0 commit comments

Comments
 (0)