Skip to content

Commit 3ebc976

Browse files
committed
Force client class to be async when kernel manager is MultiKernelManager
1 parent 059c505 commit 3ebc976

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nbclient/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ async def async_start_new_kernel_client(self, **kwargs):
388388
except AttributeError:
389389
raise AttributeError('self.km={} has no client() or get_kernel() method, '
390390
'what is this?'.format(self.km))
391+
# since self.km is a MultiKernelManager, it might not be async
392+
# so let's ensure the client is async
393+
km.client_class = 'jupyter_client.asynchronous.AsyncKernelClient'
391394

392395
self.kc = km.client()
393396
await ensure_async(self.kc.start_channels())

0 commit comments

Comments
 (0)