Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding reset_kc to setup_kernel #53

Merged
merged 6 commits into from
May 20, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nbclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ def setup_kernel(self, **kwargs):
When control returns from the yield it stops the client's zmq channels, and shuts
down the kernel.
"""
reset_kc = kwargs.pop('reset_kc', False)
danielfrg marked this conversation as resolved.
Show resolved Hide resolved

# Can't use run_until_complete on an asynccontextmanager function :(
if self.km is None:
self.start_kernel_manager()
Expand All @@ -420,7 +422,8 @@ def setup_kernel(self, **kwargs):
try:
yield
finally:
self._cleanup_kernel()
if reset_kc:
self._cleanup_kernel()

@asynccontextmanager
async def async_setup_kernel(self, **kwargs):
Expand Down