Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fee873c

Browse filesBrowse files
committed
NBAgg: fix Jupyter shim warning
Import Comm from ipykernel to avoid warning and fall back to the old location if needed
1 parent 1e1173b commit fee873c
Copy full SHA for fee873c

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎lib/matplotlib/backends/backend_nbagg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_nbagg.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
import tornado.ioloop
1515

1616
from IPython.display import display, Javascript, HTML
17-
from IPython.kernel.comm import Comm
17+
try:
18+
# Jupyter/IPython 4.x or later
19+
from ipykernel.comm import Comm
20+
except ImportError:
21+
# Jupyter/IPython 3.x or earlier
22+
from IPython.kernel.comm import Comm
1823

1924
from matplotlib import rcParams
2025
from matplotlib.figure import Figure

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.