@@ -411,7 +411,7 @@ def setup_kernel(self, **kwargs):
411
411
When control returns from the yield it stops the client's zmq channels, and shuts
412
412
down the kernel.
413
413
"""
414
- reset_kc = kwargs .pop ('reset_kc ' , False )
414
+ cleanup_kc = kwargs .pop ('cleanup_kc ' , True )
415
415
416
416
# Can't use run_until_complete on an asynccontextmanager function :(
417
417
if self .km is None :
@@ -422,7 +422,7 @@ def setup_kernel(self, **kwargs):
422
422
try :
423
423
yield
424
424
finally :
425
- if reset_kc :
425
+ if cleanup_kc :
426
426
self ._cleanup_kernel ()
427
427
428
428
@asynccontextmanager
@@ -435,7 +435,7 @@ async def async_setup_kernel(self, **kwargs):
435
435
When control returns from the yield it stops the client's zmq channels, and shuts
436
436
down the kernel.
437
437
"""
438
- reset_kc = kwargs .pop ('reset_kc ' , False )
438
+ cleanup_kc = kwargs .pop ('cleanup_kc ' , True )
439
439
if self .km is None :
440
440
self .start_kernel_manager ()
441
441
@@ -444,7 +444,7 @@ async def async_setup_kernel(self, **kwargs):
444
444
try :
445
445
yield
446
446
finally :
447
- if reset_kc :
447
+ if cleanup_kc :
448
448
await self ._async_cleanup_kernel ()
449
449
450
450
async def async_execute (self , ** kwargs ):
@@ -457,16 +457,16 @@ async def async_execute(self, **kwargs):
457
457
Any option for `self.kernel_manager_class.start_kernel()`. Because
458
458
that defaults to AsyncKernelManager, this will likely include options
459
459
accepted by `AsyncKernelManager.start_kernel()``, which includes `cwd`.
460
- If present, `reset_kc` is passed to `self.async_setup_kernel`:
461
- if True, the kernel client will be reset and a new one will be created
462
- and cleaned up after execution (default: False).
460
+
461
+ `reset_kc` if True, the kernel client will be reset and a new one
462
+ will be created (default: False).
463
463
464
464
Returns
465
465
-------
466
466
nb : NotebookNode
467
467
The executed notebook.
468
468
"""
469
- reset_kc = kwargs .get ('reset_kc' , False )
469
+ reset_kc = kwargs .pop ('reset_kc' , False )
470
470
if reset_kc :
471
471
await self ._async_cleanup_kernel ()
472
472
self .reset_execution_trackers ()
0 commit comments