Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 369c3c3

Browse files
authored
Merge pull request #13929 from anntzer/rcdeprecated
Better handle deprecated rcParams.
2 parents 44d503e + 214dbca commit 369c3c3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/matplotlib/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,9 @@ def __getitem__(self, key):
824824
def __repr__(self):
825825
class_name = self.__class__.__name__
826826
indent = len(class_name) + 1
827-
repr_split = pprint.pformat(dict(self), indent=1,
828-
width=80 - indent).split('\n')
827+
with cbook._suppress_matplotlib_deprecation_warning():
828+
repr_split = pprint.pformat(dict(self), indent=1,
829+
width=80 - indent).split('\n')
829830
repr_indented = ('\n' + ' ' * indent).join(repr_split)
830831
return '{}({})'.format(class_name, repr_indented)
831832

lib/matplotlib/tests/test_style.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_alias(equiv_styles):
145145
rc_dicts = []
146146
for sty in equiv_styles:
147147
with style.context(sty):
148-
rc_dicts.append(dict(mpl.rcParams))
148+
rc_dicts.append(mpl.rcParams.copy())
149149

150150
rc_base = rc_dicts[0]
151151
for nm, rc in zip(equiv_styles[1:], rc_dicts[1:]):

0 commit comments

Comments
 (0)