python/lib/moresetuptools.py: also catch WindowsError and other exceptions
authorPaul Brossier <piem@piem.org>
Sun, 15 May 2016 14:51:59 +0000 (16:51 +0200)
committerPaul Brossier <piem@piem.org>
Sun, 15 May 2016 21:26:56 +0000 (23:26 +0200)
python/lib/moresetuptools.py

index 9d1add1..3ff5ebd 100644 (file)
@@ -21,11 +21,11 @@ def add_packages(packages, ext=None, **kw):
              }
 
     for package in packages:
              }
 
     for package in packages:
+        cmd = ['pkg-config', '--libs', '--cflags', package]
         try:
         try:
-            cmd = ['pkg-config', '--libs', '--cflags', package]
             tokens = subprocess.check_output(cmd)
             tokens = subprocess.check_output(cmd)
-        except subprocess.CalledProcessError:
-            print("{:s} could not be found".format(package))
+        except Exception as e:
+            print("Running \"{:s}\" failed: {:s}".format(' '.join(cmd), repr(e)))
             continue
         tokens = tokens.decode('utf8').split()
         for token in tokens:
             continue
         tokens = tokens.decode('utf8').split()
         for token in tokens: