Skip to content

Commit

Permalink
Merge pull request #2441 from torcolvin/master
Browse files Browse the repository at this point in the history
Catch stderr as well as stdout
  • Loading branch information
mdboom committed Oct 1, 2013
2 parents 6a5aa01 + 0b604b3 commit 0b84819
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/matplotlib/font_manager.py
Expand Up @@ -269,7 +269,9 @@ def get_fontconfig_fonts(fontext='ttf'):

fontfiles = {}
try:
pipe = subprocess.Popen(['fc-list', '--format=%{file}\\n'], stdout=subprocess.PIPE)
pipe = subprocess.Popen(['fc-list', '--format=%{file}\\n'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output = pipe.communicate()[0]
except (OSError, IOError):
# Calling fc-list did not work, so we'll just return nothing
Expand Down Expand Up @@ -1298,7 +1300,8 @@ def fc_match(pattern, fontext):
try:
pipe = subprocess.Popen(
['fc-match', '-s', '--format=%{file}\\n', pattern],
stdout=subprocess.PIPE)
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output = pipe.communicate()[0]
except (OSError, IOError):
return None
Expand Down

0 comments on commit 0b84819

Please sign in to comment.