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

Skip to content

Commit ae005f3

Browse files
committed
FIX: over-ride 'copy' on RcParams
This is due to a fix on upstream cpython ( python/cpython@d45a961 ) which fixed the copy behavior to fall back to the sub-class's `__getitem__` which seems correct, but we were relying on it _not_ correctly hitting our custom `__getitem__`. closes #12601
1 parent 65bceb1 commit ae005f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,10 @@ def find_all(self, pattern):
924924
for key, value in self.items()
925925
if pattern_re.search(key))
926926

927+
def copy(self):
928+
return {k: dict.__getitem__(self, k)
929+
for k in self}
930+
927931

928932
def rc_params(fail_on_error=False):
929933
"""Return a :class:`matplotlib.RcParams` instance from the

0 commit comments

Comments
 (0)