Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93cb7b7

Browse files
committed
use PlotlyErrors instead of Exception
1 parent 9f15456 commit 93cb7b7

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

plotly/offline.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import plotly.plotly as py
1414
from plotly import utils
15-
from plotly import exceptions
15+
from plotly.exceptions import PlotlyError
1616

1717
PLOTLY_OFFLINE_DIRECTORY = plotlyjs_path = os.path.expanduser(
1818
os.path.join(*'~/.plotly/plotlyjs'.split('/')))
@@ -53,15 +53,15 @@ def init_notebook_mode():
5353
from IPython.display import HTML, display
5454

5555
if not os.path.exists(PLOTLY_OFFLINE_BUNDLE):
56-
raise Exception('Plotly Offline source file at {source_path} '
57-
'is not found.\n'
58-
'If you have a Plotly Offline license, then try '
59-
'running plotly.offline.download_plotlyjs(url) '
60-
'with a licensed download url.\n'
61-
"Don't have a Plotly Offline license? "
62-
'Contact [email protected] learn more about licensing.\n'
63-
'Questions? [email protected].'
64-
.format(source_path=PLOTLY_OFFLINE_BUNDLE))
56+
raise PlotlyError('Plotly Offline source file at {source_path} '
57+
'is not found.\n'
58+
'If you have a Plotly Offline license, then try '
59+
'running plotly.offline.download_plotlyjs(url) '
60+
'with a licensed download url.\n'
61+
"Don't have a Plotly Offline license? "
62+
'Contact [email protected] learn more about licensing.\n'
63+
'Questions? [email protected].'
64+
.format(source_path=PLOTLY_OFFLINE_BUNDLE))
6565

6666
global __PLOTLY_OFFLINE_INITIALIZED
6767
__PLOTLY_OFFLINE_INITIALIZED = True
@@ -97,7 +97,7 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly'):
9797
```
9898
"""
9999
if not __PLOTLY_OFFLINE_INITIALIZED:
100-
raise exceptions.PlotlyError('\n'.join([
100+
raise PlotlyError('\n'.join([
101101
'Plotly Offline mode has not been initialized in this notebook. '
102102
'Run: ',
103103
'',

0 commit comments

Comments
 (0)