Skip to content

Set __name__ for list validators in rcsetup. #8261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ def f(s):
return [scalar_validator(v) for v in s
if not isinstance(v, six.string_types) or v]
else:
msg = "{0!r} must be of type: string or non-dictionary iterable.".format(s)
raise ValueError(msg)
raise ValueError("{!r} must be of type: string or non-dictionary "
"iterable".format(s))
# Cast `str` to keep Py2 happy despite `unicode_literals`.
try:
f.__name__ = str("{}list".format(scalar_validator.__name__))
except AttributeError: # class instance.
f.__name__ = str("{}List".format(type(scalar_validator).__name__))
f.__doc__ = scalar_validator.__doc__
return f

Expand Down