Skip to content

Commit

Permalink
Use kernel_id from provider's manager
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-bates committed Jul 22, 2019
1 parent 9d3c7e0 commit ab84f2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion notebook/services/kernels/kernelmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,16 @@ def start_launching_kernel(self, path=None, kernel_name=None, **kwargs):
"""
if path is not None:
kwargs['cwd'] = self.cwd_for_path(path)
kernel_id = str(uuid.uuid4())

if kernel_name is None:
kernel_name = 'pyimport/kernel'
elif '/' not in kernel_name:
kernel_name = 'spec/' + kernel_name

kernel = KernelInterface(kernel_name, self.kernel_finder)
kernel_id = kernel.manager.kernel_id
if kernel_id is None: # if provider didn't set a kernel_id, let's associate one to this kernel
kernel_id = str(uuid.uuid4())
self._kernels[kernel_id] = kernel

self.start_watching_activity(kernel_id)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
'traitlets>=4.2.1',
'jupyter_core>=4.4.0',
'jupyter_client>=5.2.0',
'jupyter_kernel_mgmt>=0.3',
'jupyter_kernel_mgmt>=0.4',
'jupyter_protocol',
'nbformat',
'nbconvert',
Expand Down

0 comments on commit ab84f2a

Please sign in to comment.