[Piglit] [PATCH] core: Catch all exceptions when collect_system_info() programs fail

Tom Stellard thomas.stellard at amd.com
Tue Jun 24 07:08:42 PDT 2014


Otherwise it is not possible to run piglit without X, because glxinfo
will requires a running X server.
---
 framework/core.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index de5afa0..af36d8c 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -125,12 +125,8 @@ def collect_system_info():
         try:
             result[name] = subprocess.check_output(command,
                                                    stderr=subprocess.STDOUT)
-        except OSError as e:
-            # If we get the 'no file or directory' error then pass, that means
-            # that the binary isn't installed or isn't relavent to the system
-            if e.errno != 2:
-                raise
-
+        except Exception as e:
+            result[name] = 'Failed to run: %'.format(name)
     return result
 
 
-- 
1.8.1.5



More information about the Piglit mailing list