Skip to content

Commit ad34abf

Browse files
Tor ColvinTor Colvin
Tor Colvin
authored and
Tor Colvin
committed
Catch IOError which is thrown by OS X
This error comes up easily becuase fc-list is a X11 program, which is missing or misconfigured on OS X.
1 parent 7357285 commit ad34abf

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)