Skip to content

Commit 2935b99

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 737ac0c commit 2935b99

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
@@ -835,7 +835,7 @@ def set_style(self, style):
835835
"""
836836
if style is None:
837837
style = rcParams['font.style']
838-
if style not in ('normal', 'italic', 'oblique', None):
838+
if style not in ('normal', 'italic', 'oblique'):
839839
raise ValueError("style must be normal, italic or oblique")
840840
self._slant = style
841841
set_slant = set_style
@@ -846,7 +846,7 @@ def set_variant(self, variant):
846846
"""
847847
if variant is None:
848848
variant = rcParams['font.variant']
849-
if variant not in ('normal', 'small-caps', None):
849+
if variant not in ('normal', 'small-caps'):
850850
raise ValueError("variant must be normal or small-caps")
851851
self._variant = variant
852852

0 commit comments

Comments
 (0)