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

Tom Stellard tom at stellard.net
Tue Jun 24 14:53:44 PDT 2014


On Tue, Jun 24, 2014 at 01:21:41PM -0700, Dylan Baker wrote:
> 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
> 

Tested-by: Tom Stellard <thomas.stellard at amd.com>

> Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
> ---
> 
> Tom,
> 
> 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:
>                  raise
> +        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
>  
> -- 
> 2.0.0
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list