|
From: <jo...@us...> - 2009-11-12 17:57:21
|
Revision: 7955
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7955&view=rev
Author: jouni
Date: 2009-11-12 17:57:13 +0000 (Thu, 12 Nov 2009)
Log Message:
-----------
Fix previous EINTR fix in case fc-list cannot be run
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/font_manager.py
Modified: trunk/matplotlib/lib/matplotlib/font_manager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/font_manager.py 2009-11-12 17:31:19 UTC (rev 7954)
+++ trunk/matplotlib/lib/matplotlib/font_manager.py 2009-11-12 17:57:13 UTC (rev 7955)
@@ -295,8 +295,13 @@
fontext = get_fontext_synonyms(fontext)
fontfiles = {}
- pipe = subprocess.Popen(['fc-list', '', 'file'], stdout=subprocess.PIPE)
- output = pipe.communicate()[0]
+ try:
+ pipe = subprocess.Popen(['fc-list', '', 'file'], stdout=subprocess.PIPE)
+ output = pipe.communicate()[0]
+ except OSError:
+ # Calling fc-list did not work, so we'll just return nothing
+ return fontfiles
+
if pipe.returncode == 0:
for line in output.split('\n'):
fname = line.split(':')[0]
@@ -1242,8 +1247,11 @@
def fc_match(pattern, fontext):
fontexts = get_fontext_synonyms(fontext)
ext = "." + fontext
- pipe = subprocess.Popen(['fc-match', '-sv', pattern], stdout=subprocess.PIPE)
- output = pipe.communicate()[0]
+ try:
+ pipe = subprocess.Popen(['fc-match', '-sv', pattern], stdout=subprocess.PIPE)
+ output = pipe.communicate()[0]
+ except OSError:
+ return None
if pipe.returncode == 0:
for match in _fc_match_regex.finditer(output):
file = match.group(1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|