Skip to content

Commit bf678f2

Browse files
committed
fix handling of context
1 parent 9dbe109 commit bf678f2

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

jupyter_client/client.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ class KernelClient(ConnectionFileMixin):
9393
# The PyZMQ Context to use for communication with the kernel.
9494
context = Instance(zmq.asyncio.Context)
9595

96-
_created_context: Bool = Bool(False)
97-
9896
def _context_default(self) -> zmq.asyncio.Context:
99-
self._created_context = True
10097
return zmq.asyncio.Context()
10198

10299
# The classes to use for the various channels
@@ -290,9 +287,6 @@ def start_channels(
290287
:meth:`start_kernel`. If the channels have been stopped and you
291288
call this, :class:`RuntimeError` will be raised.
292289
"""
293-
# Create the context if needed.
294-
if not self._created_context:
295-
self.context = self._context_default()
296290
if iopub:
297291
self.iopub_channel.start()
298292
if shell:
@@ -322,8 +316,6 @@ def stop_channels(self) -> None:
322316
self.hb_channel.stop()
323317
if self.control_channel.is_alive():
324318
self.control_channel.stop()
325-
if self._created_context:
326-
self._created_context = False
327319

328320
@property
329321
def channels_running(self) -> bool:

0 commit comments

Comments
 (0)