8000 MNT: special case 'backend' in rc_file · matplotlib/matplotlib@75cc617 · GitHub
[go: up one dir, main page]

Skip to content

Commit 75cc617

Browse files
tacaswellanntzer
authored andcommitted
MNT: special case 'backend' in rc_file
1 parent 2c1f52c commit 75cc617

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/matplotlib/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,13 @@ def rc_file(fname):
12451245
with warnings.catch_warnings():
12461246
warnings.simplefilter("ignore", mplDeprecation)
12471247
from .style.core import STYLE_BLACKLIST
1248-
rcParams.update({k: v for k, v in rc_params_from_file(fname).items()
1249-
if k not in STYLE_BLACKLIST})
1248+
rc_from_file = rc_params_from_file(fname)
1249+
rcParams.update({k: rc_from_file[k] for k in rc_from_file
1250+
if k not in STYLE_BLACKLIST and k != 'backend'})
1251+
1252+
proposed_backend = dict.__getitem__(rc_from_file, 'backend')
1253+
if (proposed_backend is not rcsetup._auto_backend_sentinel):
1254+
rcParams['backend'] = proposed_backend
12501255

12511256

12521257
class rc_context:

0 commit comments

Comments
 (0)
0