Skip to content

Commit 0b604b3

Browse files
Tor ColvinTor Colvin
Tor Colvin
authored and
Tor Colvin
committed
Catch stderr as well as stdout
1 parent 6a5aa01 commit 0b604b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: lib/matplotlib/font_manager.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ def get_fontconfig_fonts(fontext='ttf'):
269269

270270
fontfiles = {}
271271
try:
272-
pipe = subprocess.Popen(['fc-list', '--format=%{file}\\n'], stdout=subprocess.PIPE)
272+
pipe = subprocess.Popen(['fc-list', '--format=%{file}\\n'],
273+
stdout=subprocess.PIPE,
274+
stderr=subprocess.PIPE)
273275
output = pipe.communicate()[0]
274276
except (OSError, IOError):
275277
# Calling fc-list did not work, so we'll just return nothing
@@ -1298,7 +1300,8 @@ def fc_match(pattern, fontext):
12981300
try:
12991301
pipe = subprocess.Popen(
13001302
['fc-match', '-s', '--format=%{file}\\n', pattern],
1301-
stdout=subprocess.PIPE)
1303+
stdout=subprocess.PIPE,
1304+
stderr=subprocess.PIPE)
13021305
output = pipe.communicate()[0]
13031306
except (OSError, IOError):
13041307
return None

0 commit comments

Comments
 (0)