Skip to content

Commit 973dd5e

Browse files
committed
Fix for Python 3: decode non Unicode strings
1 parent 278913d commit 973dd5e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,10 @@ def _validate_linestyle(ls):
912912
"""
913913
# Look first for a valid named line style, like '--' or 'solid'
914914
try:
915-
return _validate_named_linestyle(ls)
915+
if hasattr(ls, 'decode'):
916+
return _validate_named_linestyle(ls.decode())
917+
else:
918+
return _validate_named_linestyle(ls)
916919
except (KeyError, AttributeError):
917920
# AttributeError may be raised by ls.lower() that can be called
918921
# inside _validate_named_linestyle.

0 commit comments

Comments
 (0)