[Piglit] [Patch v3 2/8] igt.py: Change an empty string to a list

Dylan Baker baker.dylan.c at gmail.com
Wed Jan 28 11:35:02 PST 2015


Currently there is a function that in some cases could return '', but
the output is assumed to be a list. This patch ensures that it always
returns a list.

v3: - further simplify the function by using two return statements
      instead of a single return and assignment

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 tests/igt.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/igt.py b/tests/igt.py
index d54bb65..aa9465b 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -107,17 +107,15 @@ def listTests(listname):
         lines = (line.rstrip() for line in f.readlines())
 
     found_header = False
-    progs = ""
 
     for line in lines:
         if found_header:
-            progs = line.split(" ")
-            break
+            return line.split(" ")
 
         if "TESTLIST" in line:
             found_header = True
 
-    return progs
+    return []
 
 tests = listTests("single-tests")
 tests.extend(listTests("multi-tests"))
-- 
2.2.2



More information about the Piglit mailing list