Skip to content

Commit 64f81fc

Browse files
committed
Re-add some type checking to avoid FutureWarning w/ a Numpy array
1 parent 67e0ad5 commit 64f81fc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -915,12 +915,11 @@ def _validate_linestyle(ls):
915915
the on-off ink sequences.
916916
"""
917917
# Look first for a valid named line style, like '--' or 'solid'
918-
try:
919-
return _validate_named_linestyle(ls)
920-
except (KeyError, AttributeError):
921-
# AttributeError may be raised by ls.lower() that can be called
922-
# inside _validate_named_linestyle.
923-
pass
918+
if isinstance(ls, six.string_types):
919+
try:
920+
return _validate_named_linestyle(ls)
921+
except KeyError:
922+
pass
924923

925924
# On-off ink (in points) sequence *of even length*.
926925
# Offset is set to None.

0 commit comments

Comments
 (0)