From de281fe317e9ab886695a08b5d04e976325c7283 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 27 Apr 2020 23:39:18 -0400 Subject: [PATCH] Backport PR #17252: Fix bug where matplotlib.style('default') resets the backend --- lib/matplotlib/style/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/style/core.py b/lib/matplotlib/style/core.py index 577c9f51e7a5..27763d370fd2 100644 --- a/lib/matplotlib/style/core.py +++ b/lib/matplotlib/style/core.py @@ -43,14 +43,14 @@ def _remove_blacklisted_style_params(d, warn=True): o = {} - for key, val in d.items(): + for key in d: # prevent triggering RcParams.__getitem__('backend') if key in STYLE_BLACKLIST: if warn: cbook._warn_external( "Style includes a parameter, '{0}', that is not related " "to style. Ignoring".format(key)) else: - o[key] = val + o[key] = d[key] return o