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

Skip to content

Commit d0d76ad

Browse files
committed
MNT: let bad rcParam keys pass
1 parent 9bfd631 commit d0d76ad

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

lib/matplotlib/__init__.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -830,12 +830,17 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
830830
rcParamsOrig = RcParams(rcParams.copy())
831831
# This also checks that all rcParams are indeed listed in the template.
832832
# Assigning to rcsetup.defaultParams is left only for backcompat.
833-
defaultParams = rcsetup.defaultParams = {
834-
# We want to resolve deprecated rcParams, but not backend...
835-
key: [(rcsetup._auto_backend_sentinel if key == "backend" else
836-
rcParamsDefault[key]),
837-
validator]
838-
for key, validator in rcsetup._validators.items()}
833+
defaultParams = {}
834+
for key, validator in rcsetup._validators.items():
835+
if key == 'backend':
836+
defaultParams['backend'] = rcsetup._auto_backend_sentinel
837+
elif key in rcParamsDefault.keys():
838+
defaultParams[key] = validator
839+
else:
840+
_api.warn_external(f'rcsetup key "{key}" not in the default'
841+
' rcParams')
842+
rcsetup.defaultParams = defaultParams
843+
839844
if rcParams['axes.formatter.use_locale']:
840845
locale.setlocale(locale.LC_ALL, '')
841846

0 commit comments

Comments
 (0)