Skip to content

Commit b079583

Browse files
committed
MNT: remove None from value checks
`None` used to be a valid value for the style/slant and variant, however in cc61700 the behavior was changed to look up the defaults as set time (not get time) so there is no reason to allow invalid values to be set to the internal state.
1 parent a578628 commit b079583

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ def set_style(self, style):
834834
"""
835835
if style is None:
836836
style = rcParams['font.style']
837-
if style not in ('normal', 'italic', 'oblique', None):
837+
if style not in ('normal', 'italic', 'oblique'):
838838
raise ValueError("style must be normal, italic or oblique")
839839
self._slant = style
840840
set_slant = set_style
@@ -845,7 +845,7 @@ def set_variant(self, variant):
845845
"""
846846
if variant is None:
847847
variant = rcParams['font.variant']
848-
if variant not in ('normal', 'small-caps', None):
848+
if variant not in ('normal', 'small-caps'):
849849
raise ValueError("variant must be normal or small-caps")
850850
self._variant = variant
851851

0 commit comments

Comments
 (0)