diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 8990602577bd..b73d7f7f48f4 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -885,7 +885,9 @@ def __str__(self): def __iter__(self): """Yield sorted list of keys.""" - yield from sorted(dict.__iter__(self)) + with warnings.catch_warnings(): + warnings.simplefilter('ignore', MatplotlibDeprecationWarning) + yield from sorted(dict.__iter__(self)) def __len__(self): return dict.__len__(self) @@ -907,8 +909,7 @@ def find_all(self, pattern): if pattern_re.search(key)) def copy(self): - return {k: dict.__getitem__(self, k) - for k in self} + return {k: dict.__getitem__(self, k) for k in self} def rc_params(fail_on_error=False):