File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -910,9 +910,13 @@ def _validate_linestyle(ls):
910
910
A validator for all possible line styles, the named ones *and*
911
911
the on-off ink sequences.
912
912
"""
913
- # Named line style, like u '--' or u 'solid'
914
- if isinstance ( ls , six . text_type ) :
913
+ # Look first for a valid named line style, like '--' or 'solid'
914
+ try :
915
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
916
920
917
921
# On-off ink (in points) sequence *of even length*.
918
922
# Offset is set to None.
@@ -926,7 +930,7 @@ def _validate_linestyle(ls):
926
930
# (called inside the instance of validate_nseq_float).
927
931
pass
928
932
929
- raise ValueError ("linestyle must be a string or " +
933
+ raise ValueError ("linestyle must be a valid string or " +
930
934
"an even-length sequence of floats." )
931
935
932
936
You can’t perform that action at this time.
0 commit comments