From a76a6bccc1a2f4b809bff9877d5ba2cf0b659cb0 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Fri, 28 Jul 2023 11:54:36 +0200 Subject: [PATCH] fix: support ipykernel 5 Fixes #145 --- solara/server/kernel.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/solara/server/kernel.py b/solara/server/kernel.py index 9edea72aa..9a0c10cfb 100644 --- a/solara/server/kernel.py +++ b/solara/server/kernel.py @@ -21,6 +21,7 @@ from . import settings, websocket logger = logging.getLogger("solara.server.kernel") +ipykernel_major = int(ipykernel.__version__.split(".")[0]) jsonmodule = json @@ -291,6 +292,10 @@ def set_parent(self, ident, parent, channel="shell"): """Overridden from parent to tell the display hook and output streams about the parent message. """ - super().set_parent(ident, parent, channel) + if ipykernel_major < 6: + # the channel argument was added in 6.0 + super().set_parent(ident, parent) + else: + super().set_parent(ident, parent, channel) if channel == "shell": self.shell.set_parent(parent)