File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff 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 , pipe = False ):
50+ def __init__ (self , socket , session = None , pipe = False ):
5151 """Create IOPub thread
5252
5353 Parameters
@@ -120,6 +120,15 @@ def _send_welcome_message(self, subscription):
120120 The subscription topic (UTF-8 decoded)
121121 """
122122
123+ # TODO: This early return is for backward-compatibility with ipyparallel.
124+ # This should be removed when ipykernel has been released with support of
125+ # xpub and ipyparallel has been updated to pass the session parameter
126+ # to IOPubThread upon construction.
127+ # (NB: the call to fix is here:
128+ # https://github.com/ipython/ipyparallel/blob/main/ipyparallel/engine/app.py#L679
129+ if self .session is None :
130+ return
131+
123132 content = {"subscription" : subscription }
124133
125134 header = self .session .msg_header ("iopub_welcome" )
You can’t perform that action at this time.
0 commit comments