8000 Backport PR #12658: Do not warn-depreacted when iterating over rcParams · meeseeksmachine/matplotlib@46f1995 · GitHub
[go: up one dir, main page]

Skip to content

Commit 46f1995

Browse files
jklymakMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR matplotlib#12658: Do not warn-depreacted when iterating over rcParams
1 parent 0593c59 commit 46f1995

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,9 @@ def __str__(self):
906906

907907
def __iter__(self):
908908
"""Yield sorted list of keys."""
909-
yield from sorted(dict.__iter__(self))
909+
with warnings.catch_warnings():
910+
warnings.simplefilter('ignore', MatplotlibDeprecationWarning)
911+
yield from sorted(dict.__iter__(self))
910912

911913
def __len__(self):
912914
return dict.__len__(self)
@@ -928,8 +930,7 @@ def find_all(self, pattern):
928930
if pattern_re.search(key))
929931

930932
def copy(self):
931-
return {k: dict.__getitem__(self, k)
932-
for k in self}
933+
return {k: dict.__getitem__(self, k) for k in self}
933934

934935

935936
def rc_params(fail_on_error=False):

0 commit comments

Comments
 (0)
0