Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97234b5

Browse files
committed
Re-add some type checking to avoid FutureWarning w/ a Numpy array
1 parent 9ae7265 commit 97234b5

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
@@ -911,12 +911,11 @@ def _validate_linestyle(ls):
911911
the on-off ink sequences.
912912
"""
913913
# Look first for a valid named line style, like '--' or 'solid'
914-
try:
915-
return _validate_named_linestyle(ls)
916-
except (KeyError, AttributeError):
917-
# AttributeError may be raised by ls.lower() that can be called
918-
# inside _validate_named_linestyle.
919-
pass
914+
if isinstance(ls, six.string_types):
915+
try:
916+
return _validate_named_linestyle(ls)
917+
except (KeyError):
918+
pass
920919

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

0 commit comments

Comments
 (0)