Skip to content

Commit

Permalink
Backward compat
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Feb 10, 2023
1 parent 4b16152 commit fb1aa4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion python/ipywidgets/ipywidgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@
import os

from traitlets import link, dlink
from comm import get_comm_manager
try:
from comm import get_comm_manager
except ImportError:
def get_comm_manager():
from IPython import get_ipython

return get_ipython().kernel.comm_manager

from .widgets import *

Expand Down
8 changes: 7 additions & 1 deletion python/ipywidgets/ipywidgets/widgets/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
from contextlib import contextmanager
from collections.abc import Iterable
from IPython import get_ipython
from comm import create_comm
try:
from comm import create_comm
except ImportError:
from ipykernel.comm import Comm

def create_comm(**kwargs):
return Comm(**kwargs)
from traitlets import (
Any, HasTraits, Unicode, Dict, Instance, List, Int, Set, Bytes, observe, default, Container,
Undefined)
Expand Down

0 comments on commit fb1aa4d

Please sign in to comment.