Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0e4685b + 04e950a commit bcc2852Copy full SHA for bcc2852
lib/matplotlib/rcsetup.py
@@ -72,8 +72,14 @@ def __call__(self, s):
72
s = s.lower()
73
if s in self.valid:
74
return self.valid[s]
75
- raise ValueError('Unrecognized %s string %r: valid strings are %s'
76
- % (self.key, s, list(self.valid.values())))
+ msg = (f"{s!r} is not a valid value for {self.key}; supported values "
+ f"are {[*self.valid.values()]}")
77
+ if (isinstance(s, str)
78
+ and (s.startswith('"') and s.endswith('"')
79
+ or s.startswith("'") and s.endswith("'"))
80
+ and s[1:-1] in self.valid):
81
+ msg += "; remove quotes surrounding your string"
82
+ raise ValueError(msg)
83
84
85
def _listify_validator(scalar_validator, allow_stringlist=False, *, doc=None):
0 commit comments