8000 try catch for widgets imports · abudata/plotly.py@de131c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit de131c8

Browse files
committed
try catch for widgets imports
1 parent df18c5d commit de131c8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

plotly/widgets/graph_widget.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
from collections import deque
88
from pkg_resources import resource_string
99

10+
try:
11+
from ipywidgets import widgets
12+
from traitlets import Unicode
13+
except ImportError:
14+
from IPython.html import widgets
15+
from IPython.utils.traitlets import Unicode
1016

11-
# TODO: protected imports?
12-
# from IPython.html import widgets
13-
# from IPython.utils.traitlets import Unicode
1417
from IPython.display import Javascript, display
1518

1619
import plotly.plotly.plotly as py

0 commit comments

Comments
 (0)
0