10000 Use matplotlib.cbook.warn_deprecated · matplotlib/matplotlib@0c45702 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c45702

Browse files
committed
Use matplotlib.cbook.warn_deprecated
1 parent fdf97c1 commit 0c45702

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

lib/matplotlib/sphinxext/ipython_console_highlighting.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222
from pygments.token import Comment, Generic
2323

2424
from sphinx import highlighting
25+
import matplotlib
2526

26-
import warnings
27-
warnings.warn("""
27+
matplotlib.cbook.warn_deprecated("1.4", """
2828
The Sphinx extension ipython_console_highlighting has moved from
2929
matplotlib to IPython, and its use in matplotlib is deprecated.
3030
Change your import from 'matplotlib.sphinxext.ipython_directive' to
31-
'IPython.sphinxext.ipython_directive.""",
32-
matplotlib.cbook.mplDeprecation)
31+
'IPython.sphinxext.ipython_directive.""")
3332

3433
#-----------------------------------------------------------------------------
3534
# Global constants

lib/matplotlib/sphinxext/ipython_directive.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,11 @@
8080

8181
matplotlib.use('Agg')
8282

83-
import warnings
84-
warnings.warn("""
85-
The Sphinx ipython_directive has moved from matplotlib to IPython, and
86-
its use within matplotlib is deprecated. Change your import from
87-
'matplotlib.sphinxext.ipython_directive' to
88-
'IPython.sphinxext.ipython_directive.""",
89-
matplotlib.cbook.mplDeprecation)
83+
matplotlib.cbook.warn_deprecated("1.4", """
84+
The Sphinx extension ipython_console_highlighting has moved from
85+
matplotlib to IPython, and its use in matplotlib is deprecated.
86+
Change your import from 'matplotlib.sphinxext.ipython_directive' to
87+
'IPython.sphinxext.ipython_directive.""")
9088

9189
# Our own
9290
try:

0 commit comments

Comments
 (0)
0