Skip to content

Commit fb3a50e

Browse files
committed
Expire deprecations in cbook.deprecation
1 parent 8747d14 commit fb3a50e

File tree

5 files changed

+5
-29
lines changed

5 files changed

+5
-29
lines changed

lib/matplotlib/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
# cbook must import matplotlib only within function
108108
# definitions, so it is safe to import from it here.
109109
from . import _api, _version, cbook, docstring, rcsetup
110-
from matplotlib.cbook import MatplotlibDeprecationWarning, sanitize_sequence
111-
from matplotlib.cbook import mplDeprecation # deprecated
110+
from matplotlib.cbook import sanitize_sequence
111+
from matplotlib._api import MatplotlibDeprecationWarning
112112
from matplotlib.rcsetup import validate_backend, cycler
113113

114114

lib/matplotlib/_api/deprecation.py

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ class MatplotlibDeprecationWarning(DeprecationWarning):
2121
"""A class for issuing deprecation warnings for Matplotlib users."""
2222

2323

24-
# mplDeprecation is deprecated. Use MatplotlibDeprecationWarning instead.
25-
# remove when removing the re-import from cbook
26-
mplDeprecation = MatplotlibDeprecationWarning
27-
28-
2924
def _generate_deprecation_warning(
3025
since, message='', name='', alternative='', pending=False, obj_type='',
3126
addendum='', *, removal=''):

lib/matplotlib/cbook/__init__.py

+2-13
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@
2929

3030
import matplotlib
3131
from matplotlib import _api, _c_internal_utils
32-
from matplotlib._api.deprecation import (
33-
MatplotlibDeprecationWarning, mplDeprecation)
34-
35-
36-
@_api.deprecated("3.4")
37-
def deprecated(*args, **kwargs):
38-
return _api.deprecated(*args, **kwargs)
39-
40-
41-
@_api.deprecated("3.4")
42-
def warn_deprecated(*args, **kwargs):
43-
_api.warn_deprecated(*args, **kwargs)
4432

4533

4634
def _get_running_interactive_framework():
@@ -365,7 +353,8 @@ def __repr__(self):
365353

366354

367355
def _local_over_kwdict(
368-
local_var, kwargs, *keys, warning_cls=MatplotlibDeprecationWarning):
356+
local_var, kwargs, *keys,
357+
warning_cls=_api.MatplotlibDeprecationWarning):
369358
out = local_var
370359
for key in keys:
371360
kwarg_val = kwargs.pop(key, None)

lib/matplotlib/cbook/deprecation.py

-8
This file was deleted.

lib/matplotlib/collections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ def __init__(self, segments, # Can be None.
14201420
if args:
14211421
argkw = {name: val for name, val in zip(argnames, args)}
14221422
kwargs.update(argkw)
1423-
cbook.warn_deprecated(
1423+
_api.warn_deprecated(
14241424
"3.4", message="Since %(since)s, passing LineCollection "
14251425
"arguments other than the first, 'segments', as positional "
14261426
"arguments is deprecated, and they will become keyword-only "

0 commit comments

Comments
 (0)