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

Skip to content

Commit 7b53675

Browse files
committed
Merge pull request #2154 from torcolvin/master
catch fontconfig errors on OS X
2 parents 9efe7c3 + ad34abf commit 7b53675

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def get_fontconfig_fonts(fontext='ttf'):
273273
try:
274274
pipe = subprocess.Popen(['fc-list', '', 'file'], stdout=subprocess.PIPE)
275275
output = pipe.communicate()[0]
276-
except OSError:
276+
except OSError, IOError:
277277
# Calling fc-list did not work, so we'll just return nothing
278278
return fontfiles
279279

@@ -1296,7 +1296,7 @@ def fc_match(pattern, fontext):
12961296
try:
12971297
pipe = subprocess.Popen(['fc-match', '-sv', pattern], stdout=subprocess.PIPE)
12981298
output = pipe.communicate()[0]
1299-
except OSError:
1299+
except OSError, IOError:
13001300
return None
13011301
if pipe.returncode == 0:
13021302
for match in _fc_match_regex.finditer(output):

0 commit comments

Comments
 (0)