[Piglit] [PATCH 2/2] framework: fix wflinfo GL shading language parsing code

Brian Paul brianp at vmware.com
Mon Nov 13 21:06:28 UTC 2017


With NVIDIA's driver, wflinfo reports a GLSL version line like this:
"OpenGL shading language version string: 4.40 NVIDIA via Cg compiler"
The existing parsing code didn't expect the text after the version
number and generated an exception.  Change the parsing to handle this.
---
 framework/wflinfo.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/framework/wflinfo.py b/framework/wflinfo.py
index a346003..8c7da08 100644
--- a/framework/wflinfo.py
+++ b/framework/wflinfo.py
@@ -255,9 +255,8 @@ class WflInfo(object):
             else:
                 try:
                     # GLSL versions are M.mm formatted
-                    ret = float(self.__getline(
-                        raw.split('\n'),
-                        'OpenGL shading language').split()[-1][:4])
+                    line = self.__getline(raw.split('\n'), 'OpenGL shading language')
+                    ret = float(line.split(":")[1][:5])
                 except (IndexError, ValueError):
                     # This is caused by wflinfo returning an error
                     pass
-- 
1.9.1



More information about the Piglit mailing list