Skip to content

Commit 8602912

Browse files
committed
BUG : validate_stringlist should drop empty strings
This is a minor api change, but I can't think of why one would want to carry around empty strings.
1 parent a298ab2 commit 8602912

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ def validate_colorlist(s):
267267
def validate_stringlist(s):
268268
'return a list'
269269
if isinstance(s, six.string_types):
270-
return [six.text_type(v.strip()) for v in s.split(',')]
270+
return [six.text_type(v.strip()) for v in s.split(',') if v.strip()]
271271
else:
272272
assert type(s) in [list, tuple]
273-
return [six.text_type(v) for v in s]
273+
return [six.text_type(v) for v in s if v]
274274

275275

276276
validate_orientation = ValidateInStrings(

0 commit comments

Comments
 (0)