We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 059c505 commit 75dc5beCopy full SHA for 75dc5be
nbclient/client.py
@@ -411,6 +411,8 @@ def setup_kernel(self, **kwargs):
411
When control returns from the yield it stops the client's zmq channels, and shuts
412
down the kernel.
413
"""
414
+ reset_kc = kwargs.pop('reset_kc', False)
415
+
416
# Can't use run_until_complete on an asynccontextmanager function :(
417
if self.km is None:
418
self.start_kernel_manager()
@@ -420,7 +422,8 @@ def setup_kernel(self, **kwargs):
420
422
try:
421
423
yield
424
finally:
- self._cleanup_kernel()
425
+ if reset_kc:
426
+ self._cleanup_kernel()
427
428
@asynccontextmanager
429
async def async_setup_kernel(self, **kwargs):
0 commit comments