We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b75795 commit 4130bb6Copy full SHA for 4130bb6
jupyterlab_kernel_usage/handlers.py
@@ -1,6 +1,7 @@
1
+import asyncio
2
+import ipykernel
3
import json
4
import tornado
-import asyncio
5
import zmq
6
7
from functools import partial
@@ -9,12 +10,21 @@
9
10
from jupyter_server.utils import url_path_join, ensure_async
11
from jupyter_client.jsonutil import date_default
12
13
+from packaging import version
14
+
15
16
+USAGE_IS_SUPPORTED = version.parse("6.9.0") <= version.parse(ipykernel.__version__)
17
18
19
class RouteHandler(APIHandler):
20
21
@tornado.web.authenticated
22
async def get(self, matched_part=None, *args, **kwargs):
23
24
+ if not USAGE_IS_SUPPORTED:
25
+ self.write(json.dumps({}))
26
+ return
27
28
kernel_id = matched_part
29
km = self.kernel_manager
30
lkm = km.pinned_superclass.get_kernel(km, kernel_id)
0 commit comments