Commit 53904068 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Update notebook kernel manager to use async/await rather than

tornado coroutine
parent dc78031d
......@@ -6,8 +6,6 @@
#
from tornado import gen
from notebook.services.kernels.kernelmanager import MappingKernelManager
......@@ -25,7 +23,7 @@ class FSLeyesNotebookKernelManager(MappingKernelManager):
"""
def __init__(self, *args, **kwargs):
super(FSLeyesNotebookKernelManager, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
def __patch_connection(self, kernel):
......@@ -40,16 +38,14 @@ class FSLeyesNotebookKernelManager(MappingKernelManager):
kernel.load_connection_file(self.connfile)
@gen.coroutine
def start_kernel(self, **kwargs):
async def start_kernel(self, **kwargs):
"""Overrides ``MappingKernelManager.start_kernel``. Connects
all new kernels to the IPython kernel specified by ``connfile``.
"""
kid = super(FSLeyesNotebookKernelManager, self)\
.start_kernel(**kwargs).result()
kid = await super().start_kernel(**kwargs)
kernel = self._kernels[kid]
self.__patch_connection(kernel)
raise gen.Return(kid)
return kid
def restart_kernel(self, *args, **kwargs):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment