Skip to content

Commit

Permalink
Updates for client 8 (#1188)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Jan 26, 2023
1 parent 91c5942 commit b6c1edb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions jupyter_server/gateway/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ async def shutdown_kernel(self, kernel_id, now=False, restart=False):
The purpose of this shutdown is to restart the kernel (True)
"""
km = self.get_kernel(kernel_id)
await km.shutdown_kernel(now=now, restart=restart)
await ensure_async(km.shutdown_kernel(now=now, restart=restart))
self.remove_kernel(kernel_id)

async def restart_kernel(self, kernel_id, now=False, **kwargs):
Expand All @@ -156,7 +156,7 @@ async def restart_kernel(self, kernel_id, now=False, **kwargs):
The id of the kernel to restart.
"""
km = self.get_kernel(kernel_id)
await km.restart_kernel(now=now, **kwargs)
await ensure_async(km.restart_kernel(now=now, **kwargs))

async def interrupt_kernel(self, kernel_id, **kwargs):
"""Interrupt a kernel by its kernel uuid.
Expand All @@ -167,14 +167,14 @@ async def interrupt_kernel(self, kernel_id, **kwargs):
The id of the kernel to interrupt.
"""
km = self.get_kernel(kernel_id)
await km.interrupt_kernel()
await ensure_async(km.interrupt_kernel())

async def shutdown_all(self, now=False):
"""Shutdown all kernels."""
kids = list(self._kernels)
for kernel_id in kids:
km = self.get_kernel(kernel_id)
await km.shutdown_kernel(now=now)
await ensure_async(km.shutdown_kernel(now=now))
self.remove_kernel(kernel_id)

async def cull_kernels(self):
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/services/kernels/kernelmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ async def _async_start_kernel( # type:ignore[override]
# see https://github.com/jupyter-server/jupyter_server/issues/1165
# this assignment is technically incorrect, but might need a change of API
# in jupyter_client.
start_kernel = _async_start_kernel
start_kernel = _async_start_kernel # type:ignore[assignment]

async def _finish_kernel_start(self, kernel_id):
"""Handle a kernel that finishes starting."""
Expand Down

0 comments on commit b6c1edb

Please sign in to comment.