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
@@ -665,7 +665,7 @@ def __getitem__(self, key):
665665 def __repr__ (self ):
666666 class_name = self .__class__ .__name__
667667 indent = len (class_name ) + 1
668- with cbook . _suppress_matplotlib_deprecation_warning ():
668+ with _api . suppress_matplotlib_deprecation_warning ():
669669 repr_split = pprint .pformat (dict (self ), indent = 1 ,
670670 width = 80 - indent ).split ('\n ' )
671671 repr_indented = ('\n ' + ' ' * indent ).join (repr_split )
@@ -676,7 +676,7 @@ def __str__(self):
676676
677677 def __iter__ (self ):
678678 """Yield sorted list of keys."""
679- with cbook . _suppress_matplotlib_deprecation_warning ():
679+ with _api . suppress_matplotlib_deprecation_warning ():
680680 yield from sorted (dict .__iter__ (self ))
681681
682682 def __len__ (self ):
@@ -840,10 +840,10 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
840840 if not use_default_template :
841841 return config_from_file
842842
843- with cbook . _suppress_matplotlib_deprecation_warning ():
843+ with _api . suppress_matplotlib_deprecation_warning ():
844844 config = RcParams ({** rcParamsDefault , ** config_from_file })
845845
846- with cbook . _suppress_matplotlib_deprecation_warning ():
846+ with _api . suppress_matplotlib_deprecation_warning ():
847847 if config ['datapath' ] is None :
848848 config ['datapath' ] = _get_data_path ()
849849 else :
@@ -874,7 +874,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
874874rcParams = RcParams () # The global instance.
875875dict .update (rcParams , dict .items (rcParamsDefault ))
876876dict .update (rcParams , _rc_params_in_file (matplotlib_fname ()))
877- with cbook . _suppress_matplotlib_deprecation_warning ():
877+ with _api . suppress_matplotlib_deprecation_warning ():
878878 rcParamsOrig = RcParams (rcParams .copy ())
879879 # This also checks that all rcParams are indeed listed in the template.
880880 # Assiging to rcsetup.defaultParams is left only for backcompat.
@@ -982,7 +982,7 @@ def rcdefaults():
982982 """
983983 # Deprecation warnings were already handled when creating rcParamsDefault,
984984 # no need to reemit them here.
985- with cbook . _suppress_matplotlib_deprecation_warning ():
985+ with _api . suppress_matplotlib_deprecation_warning ():
986986 from .style .core import STYLE_BLACKLIST
987987 rcParams .clear ()
988988 rcParams .update ({k : v for k , v in rcParamsDefault .items ()
@@ -998,7 +998,7 @@ def rc_file_defaults():
998998 """
999999 # Deprecation warnings were already handled when creating rcParamsOrig, no
10001000 # need to reemit them here.
1001- with cbook . _suppress_matplotlib_deprecation_warning ():
1001+ with _api . suppress_matplotlib_deprecation_warning ():
10021002 from .style .core import STYLE_BLACKLIST
10031003 rcParams .update ({k : rcParamsOrig [k ] for k in rcParamsOrig
10041004 if k not in STYLE_BLACKLIST })
@@ -1023,7 +1023,7 @@ def rc_file(fname, *, use_default_template=True):
10231023 """
10241024 # Deprecation warnings were already handled in rc_params_from_file, no need
10251025 # to reemit them here.
1026- with cbook . _suppress_matplotlib_deprecation_warning ():
1026+ with _api . suppress_matplotlib_deprecation_warning ():
10271027 from .style .core import STYLE_BLACKLIST
10281028 rc_from_file = rc_params_from_file (
10291029 fname , use_default_template = use_default_template )
0 commit comments