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

Commitbcc2852

Browse files
authored
Merge pull request#16960 from anntzer/unquoted-rc
MNT: Improve error for quoted values in matplotlibrc.
2 parents0e4685b +04e950a commitbcc2852

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎lib/matplotlib/rcsetup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,14 @@ def __call__(self, s):
7272
s=s.lower()
7373
ifsinself.valid:
7474
returnself.valid[s]
75-
raiseValueError('Unrecognized %s string %r: valid strings are %s'
76-
% (self.key,s,list(self.valid.values())))
75+
msg= (f"{s!r} is not a valid value for{self.key}; supported values "
76+
f"are{[*self.valid.values()]}")
77+
if (isinstance(s,str)
78+
and (s.startswith('"')ands.endswith('"')
79+
ors.startswith("'")ands.endswith("'"))
80+
ands[1:-1]inself.valid):
81+
msg+="; remove quotes surrounding your string"
82+
raiseValueError(msg)
7783

7884

7985
def_listify_validator(scalar_validator,allow_stringlist=False,*,doc=None):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp