Skip to content

Commit

Permalink
fix: support ipykernel 5
Browse files Browse the repository at this point in the history
Fixes #145
  • Loading branch information
maartenbreddels committed Jul 28, 2023
1 parent 22c27a5 commit a76a6bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion solara/server/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from . import settings, websocket

logger = logging.getLogger("solara.server.kernel")
ipykernel_major = int(ipykernel.__version__.split(".")[0])

jsonmodule = json

Expand Down Expand Up @@ -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)

0 comments on commit a76a6bc

Please sign in to comment.