Skip to content

Commit 6afd867

Browse files
committed
Made IOPubThread constructor backward compatible
1 parent 13e17df commit 6afd867

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ipykernel/inprocess/ipkernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class InProcessKernel(IPythonKernel):
5656

5757
@default("iopub_thread")
5858
def _default_iopub_thread(self):
59-
thread = IOPubThread(self._underlying_iopub_socket, self.session)
59+
thread = IOPubThread(self._underlying_iopub_socket, session = self.session)
6060
thread.start()
6161
return thread
6262

ipykernel/iostream.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class IOPubThread:
4747
whose IO is always run in a thread.
4848
"""
4949

50-
def __init__(self, socket, session=None, pipe=False):
50+
def __init__(self, socket, pipe=False, session=False):
5151
"""Create IOPub thread
5252
5353
Parameters
@@ -518,7 +518,7 @@ def __init__(
518518
DeprecationWarning,
519519
stacklevel=2,
520520
)
521-
pub_thread = IOPubThread(pub_thread, self.session)
521+
pub_thread = IOPubThread(pub_thread, session = self.session)
522522
pub_thread.start()
523523
self.pub_thread = pub_thread
524524
self.name = name

ipykernel/kernelapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def init_iopub(self, context):
382382
self.iopub_port = self._bind_socket(self.iopub_socket, self.iopub_port)
383383
self.log.debug("iopub PUB Channel on port: %i", self.iopub_port)
384384
self.configure_tornado_logger()
385-
self.iopub_thread = IOPubThread(self.iopub_socket, self.session, pipe=True)
385+
self.iopub_thread = IOPubThread(self.iopub_socket, pipe=True, session = self.session)
386386
self.iopub_thread.start()
387387
# backward-compat: wrap iopub socket API in background thread
388388
self.iopub_socket = self.iopub_thread.background_socket

tests/test_io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def ctx():
2828
def iopub_thread(ctx):
2929
session = Session()
3030
with ctx.socket(zmq.PUB) as pub:
31-
thread = IOPubThread(pub, session)
31+
thread = IOPubThread(pub, session=session)
3232
thread.start()
3333

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

0 commit comments

Comments
 (0)