From: Dylan Baker <[email protected]>

This moves code out of the try/except block that we don't mean to catch
exceptions in, which is better coding practice.

This also sets the except block to ValueError only, which is the error
that will occur if there aren't enough values to unpack, which the
except block was added to catch.

Signed-off-by: Dylan Baker <[email protected]>
---
 tests/oglconform.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/oglconform.py b/tests/oglconform.py
index c74f3fe..ca3b49f 100644
--- a/tests/oglconform.py
+++ b/tests/oglconform.py
@@ -80,11 +80,12 @@ def _make_profile():
         for l in f.readlines():
             try:
                 category, test = l.split()
-                group = grouptools.join('oglconform', category, test)
-                profile.test_list[group] = OGLCTest(category, test)
-            except:
+            except ValueError:
                 continue
 
+            group = grouptools.join('oglconform', category, test)
+            profile.test_list[group] = OGLCTest(category, test)
+
     return profile
 
 
-- 
2.6.2

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to