104104
105105# cbook must import matplotlib only within function
106106# definitions, so it is safe to import from it here.
107- from . import cbook , docstring , rcsetup
107+ from . import _api , cbook , docstring , rcsetup
108108from matplotlib .cbook import MatplotlibDeprecationWarning , sanitize_sequence
109109from matplotlib .cbook import mplDeprecation # deprecated
110110from matplotlib .rcsetup import validate_backend , cycler
@@ -670,7 +670,7 @@ def __getitem__(self, key):
670670 def __repr__ (self ):
671671 class_name = self .__class__ .__name__
672672 indent = len (class_name ) + 1
673- with cbook . _suppress_matplotlib_deprecation_warning ():
673+ with _api . suppress_matplotlib_deprecation_warning ():
674674 repr_split = pprint .pformat (dict (self ), indent = 1 ,
675675 width = 80 - indent ).split ('\n ' )
676676 repr_indented = ('\n ' + ' ' * indent ).join (repr_split )
@@ -681,7 +681,7 @@ def __str__(self):
681681
682682 def __iter__ (self ):
683683 """Yield sorted list of keys."""
684- with cbook . _suppress_matplotlib_deprecation_warning ():
684+ with _api . suppress_matplotlib_deprecation_warning ():
685685 yield from sorted (dict .__iter__ (self ))
686686
687687 def __len__ (self ):
@@ -845,10 +845,10 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
845845 if not use_default_template :
846846 return config_from_file
847847
848- with cbook . _suppress_matplotlib_deprecation_warning ():
848+ with _api . suppress_matplotlib_deprecation_warning ():
849849 config = RcParams ({** rcParamsDefault , ** config_from_file })
850850
851- with cbook . _suppress_matplotlib_deprecation_warning ():
851+ with _api . suppress_matplotlib_deprecation_warning ():
852852 if config ['datapath' ] is None :
853853 config ['datapath' ] = _get_data_path ()
854854 else :
@@ -879,7 +879,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
879879rcParams = RcParams () # The global instance.
880880dict .update (rcParams , dict .items (rcParamsDefault ))
881881dict .update (rcParams , _rc_params_in_file (matplotlib_fname ()))
882- with cbook . _suppress_matplotlib_deprecation_warning ():
882+ with _api . suppress_matplotlib_deprecation_warning ():
883883 rcParamsOrig = RcParams (rcParams .copy ())
884884 # This also checks that all rcParams are indeed listed in the template.
885885 # Assigning to rcsetup.defaultParams is left only for backcompat.
@@ -987,7 +987,7 @@ def rcdefaults():
987987 """
988988 # Deprecation warnings were already handled when creating rcParamsDefault,
989989 # no need to reemit them here.
990- with cbook . _suppress_matplotlib_deprecation_warning ():
990+ with _api . suppress_matplotlib_deprecation_warning ():
991991 from .style .core import STYLE_BLACKLIST
992992 rcParams .clear ()
993993 rcParams .update ({k : v for k , v in rcParamsDefault .items ()
@@ -1003,7 +1003,7 @@ def rc_file_defaults():
10031003 """
10041004 # Deprecation warnings were already handled when creating rcParamsOrig, no
10051005 # need to reemit them here.
1006- with cbook . _suppress_matplotlib_deprecation_warning ():
1006+ with _api . suppress_matplotlib_deprecation_warning ():
10071007 from .style .core import STYLE_BLACKLIST
10081008 rcParams .update ({k : rcParamsOrig [k ] for k in rcParamsOrig
10091009 if k not in STYLE_BLACKLIST })
@@ -1028,7 +1028,7 @@ def rc_file(fname, *, use_default_template=True):
10281028 """
10291029 # Deprecation warnings were already handled in rc_params_from_file, no need
10301030 # to reemit them here.
1031- with cbook . _suppress_matplotlib_deprecation_warning ():
1031+ with _api . suppress_matplotlib_deprecation_warning ():
10321032 from .style .core import STYLE_BLACKLIST
10331033 rc_from_file = rc_params_from_file (
10341034 fname , use_default_template = use_default_template )
0 commit comments