Skip to content

More use of cbook._check_in_list. #13532

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
Feb 27, 2019
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
12 changes: 4 additions & 8 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,10 +876,8 @@ def set_antialiased(self, b):

def set_capstyle(self, cs):
"""Set the capstyle to be one of ('butt', 'round', 'projecting')."""
if cs in ('butt', 'round', 'projecting'):
self._capstyle = cs
else:
raise ValueError('Unrecognized cap style. Found %s' % cs)
cbook._check_in_list(['butt', 'round', 'projecting'], cs=cs)
self._capstyle = cs

def set_clip_rectangle(self, rectangle):
"""
Expand Down Expand Up @@ -941,10 +939,8 @@ def set_foreground(self, fg, isRGBA=False):

def set_joinstyle(self, js):
"""Set the join style to be one of ('miter', 'round', 'bevel')."""
if js in ('miter', 'round', 'bevel'):
self._joinstyle = js
else:
raise ValueError('Unrecognized join style. Found %s' % js)
cbook._check_in_list(['miter', 'round', 'bevel'], js=js)
self._joinstyle = js

def set_linewidth(self, w):
"""Set the linewidth in points."""
Expand Down