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.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to