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

Skip to content

Commit d5403fb

Browse files
committed
Fix Python 3 unicode issue
1 parent 8f9b76b commit d5403fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/font_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,14 @@ def ttfFontProperty(font):
391391
sfnt2 = sfnt.get((1,0,0,2))
392392
sfnt4 = sfnt.get((1,0,0,4))
393393
if sfnt2:
394-
sfnt2 = sfnt2.lower()
394+
sfnt2 = sfnt2.decode('ascii').lower()
395395
else:
396396
sfnt2 = ''
397397
if sfnt4:
398-
sfnt4 = sfnt4.lower()
398+
sfnt4 = sfnt4.decode('ascii').lower()
399399
else:
400400
sfnt4 = ''
401-
if sfnt4.find('oblique') >= 0:
401+
if sfnt4.find('oblique') >= 0:
402402
style = 'oblique'
403403
elif sfnt4.find('italic') >= 0:
404404
style = 'italic'

0 commit comments

Comments
 (0)