[Piglit] [PATCH] core.py: Add additional catch to collect_system_info()

Dylan Baker baker.dylan.c at gmail.com
Tue Jun 24 13:21:41 PDT 2014

Catch subprocess.CalledProcessError, which is an exception that
subprocess.check_call() raises if the binary returns a non 0 status.
The usual culprit for this is glxinfo on systems not running X

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>


I'm not a fan of catching exceptions in such a blanket manner, even if
in this case it probably is fine. I think it's better to catch the
specific exception and pass.

 framework/core.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/framework/core.py b/framework/core.py
index de5afa0..675b7aa 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -130,6 +130,10 @@ def collect_system_info():
             # that the binary isn't installed or isn't relavent to the system
             if e.errno != 2:
+        except subprocess.CalledProcessError:
+            # If the binary is installed by doesn't work on the window system
+            # (glxinfo) it will raise this error. go on
+            pass
     return result

More information about the Piglit mailing list