[Piglit] [PATCH 06/13] shader_test.py: use os.path.splitext instead of rsplit('.')

Dylan Baker baker.dylan.c at gmail.com
Thu Feb 12 10:38:42 PST 2015


Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/test/shader_test.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index ee44ddb..16d813f 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -107,8 +107,7 @@ def add_shader_test_dir(group, dirpath):
         if path.isdir(filepath):
             add_shader_test_dir(group[filename], filepath)
         else:
-            ext = filename.rsplit('.')[-1]
-            if ext != 'shader_test':
+            testname, ext = os.path.splitext(filename)
+            if ext != '.shader_test':
                 continue
-            testname = filename[0:-(len(ext) + 1)]  # +1 for '.'
             group[testname] = ShaderTest(filepath)
-- 
2.3.0



More information about the Piglit mailing list