Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ipykernel/inprocess/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class InProcessKernel(IPythonKernel):

@default("iopub_thread")
def _default_iopub_thread(self):
thread = IOPubThread(self._underlying_iopub_socket, self.session)
thread = IOPubThread(self._underlying_iopub_socket, session=self.session)
thread.start()
return thread

Expand Down
4 changes: 2 additions & 2 deletions ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class IOPubThread:
whose IO is always run in a thread.
"""

def __init__(self, socket, session=None, pipe=False):
def __init__(self, socket, pipe=False, session=False):
"""Create IOPub thread

Parameters
Expand Down Expand Up @@ -518,7 +518,7 @@ def __init__(
DeprecationWarning,
stacklevel=2,
)
pub_thread = IOPubThread(pub_thread, self.session)
pub_thread = IOPubThread(pub_thread, session=self.session)
pub_thread.start()
self.pub_thread = pub_thread
self.name = name
Expand Down
2 changes: 1 addition & 1 deletion ipykernel/kernelapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def init_iopub(self, context):
self.iopub_port = self._bind_socket(self.iopub_socket, self.iopub_port)
self.log.debug("iopub PUB Channel on port: %i", self.iopub_port)
self.configure_tornado_logger()
self.iopub_thread = IOPubThread(self.iopub_socket, self.session, pipe=True)
self.iopub_thread = IOPubThread(self.iopub_socket, pipe=True, session=self.session)
self.iopub_thread.start()
# backward-compat: wrap iopub socket API in background thread
self.iopub_socket = self.iopub_thread.background_socket
Expand Down
4 changes: 2 additions & 2 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def ctx():
def iopub_thread(ctx):
session = Session()
with ctx.socket(zmq.PUB) as pub:
thread = IOPubThread(pub, session)
thread = IOPubThread(pub, session=session)
thread.start()

yield thread
Expand Down Expand Up @@ -156,7 +156,7 @@ def subprocess_test_echo_watch():
# use PUSH socket to avoid subscription issues
with zmq.Context() as ctx, ctx.socket(zmq.PUSH) as pub:
pub.connect(os.environ["IOPUB_URL"])
iopub_thread = IOPubThread(pub, session)
iopub_thread = IOPubThread(pub, session=session)
iopub_thread.start()
stdout_fd = sys.stdout.fileno()
sys.stdout.flush()
Expand Down