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

Prevent failure if kernel is not found when shutting it down #694

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Changes from all 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
4 changes: 2 additions & 2 deletions jupyter_client/multikernelmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ def remove_kernel(self, kernel_id: str) -> KernelManager:
Mainly so that a kernel can be removed if it is already dead,
without having to call shutdown_kernel.

The kernel object is returned.
The kernel object is returned, or `None` if not found.
"""
return self._kernels.pop(kernel_id)
return self._kernels.pop(kernel_id, None)

async def _shutdown_starting_kernel(self, kid: str, now: bool) -> None:
if kid in self._starting_kernels:
Expand Down