[jhbuild] systeminstall: Catch both CalledProcessError and OSError



commit 31c8983b9ca5be0e97a75012282f51df306df3a7
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Apr 24 23:34:37 2017 -0700

    systeminstall: Catch both CalledProcessError and OSError
    
    It seems that either one may be thrown under different circumstances.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775668

 jhbuild/utils/systeminstall.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/utils/systeminstall.py b/jhbuild/utils/systeminstall.py
index 75b0849..a7541ed 100644
--- a/jhbuild/utils/systeminstall.py
+++ b/jhbuild/utils/systeminstall.py
@@ -47,7 +47,7 @@ def get_installed_pkgconfigs(config):
             versions = stdout.splitlines()
             if len(versions) == len(pkgs):
                 return dict(zip(pkgs, versions))
-        except subprocess.CalledProcessError:
+        except (subprocess.CalledProcessError, OSError):
             pass
 
         # We have to rather inefficiently repeatedly fork to work around
@@ -60,7 +60,7 @@ def get_installed_pkgconfigs(config):
             stdout = proc.communicate()[0]
             proc.wait()
             pkgversions[pkg] = stdout.strip()
-    except subprocess.CalledProcessError: # pkg-config not installed
+    except (subprocess.CalledProcessError, OSError): # pkg-config not installed
         pass
     return pkgversions
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]