Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1188b83

Browse files
authored
Merge pull request#24601 from meeseeksmachine/auto-backport-of-pr-24600-on-v3.6.x
Backport PR#24600 on branch v3.6.x (Fix: Gracefully fail the string validator for tuple inputs)
2 parents382db61 +149ab12 commit1188b83

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎lib/matplotlib/rcsetup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __call__(self, s):
6868
name,= (kfork,vinglobals().items()ifvisself)
6969
_api.warn_deprecated(
7070
self._deprecated_since,name=name,obj_type="function")
71-
ifself.ignorecase:
71+
ifself.ignorecaseandisinstance(s,str):
7272
s=s.lower()
7373
ifsinself.valid:
7474
returnself.valid[s]

‎lib/matplotlib/tests/test_rcparams.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
importcopy
22
importos
33
frompathlibimportPath
4+
importre
45
importsubprocess
56
importsys
67
fromunittestimportmock
@@ -591,3 +592,10 @@ def test_deprecation(monkeypatch):
591592
# Note that the warning suppression actually arises from the
592593
# iteration over the updater rcParams being protected by
593594
# suppress_matplotlib_deprecation_warning, rather than any explicit check.
595+
596+
597+
deftest_rcparams_legend_loc():
598+
value= (0.9,.7)
599+
match_str=f"{value} is not a valid value for legend.loc;"
600+
withpytest.raises(ValueError,match=re.escape(match_str)):
601+
mpl.RcParams({'legend.loc':value})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp