[Piglit] [PATCH 33/45] gen_outerproduct_invalid_params.py: use os.path.join for dirnames

Dylan Baker baker.dylan.c at gmail.com
Wed Nov 12 15:46:15 PST 2014


Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 generated_tests/gen_outerproduct_invalid_params.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/generated_tests/gen_outerproduct_invalid_params.py b/generated_tests/gen_outerproduct_invalid_params.py
index 9d9b0ec..38e2d67 100644
--- a/generated_tests/gen_outerproduct_invalid_params.py
+++ b/generated_tests/gen_outerproduct_invalid_params.py
@@ -26,7 +26,6 @@ import mako.template
 
 def main():
     """ Generate tests """
-
     template = mako.template.Template(textwrap.dedent("""
     /* [config]
      * expect_result: fail
@@ -40,16 +39,15 @@ def main():
     }
     """))
 
-    try:
-        os.makedirs('spec/glsl-1.20/compiler/built-in-functions')
-    except OSError:
-        pass
+    dirname = os.path.join('spec', 'glsl-1.20', 'compiler',
+                           'built-in-functions')
+    if not os.path.exists(dirname):
+        os.makedirs(dirname)
 
     for type_ in ['int', 'float', 'bool', 'bvec2', 'bvec3', 'bvec4', 'mat2',
                   'mat2x2', 'mat2x3', 'mat2x4', 'mat3', 'mat3x2', 'mat3x3',
                   'mat3x4', 'mat4', 'mat4x2', 'mat4x3', 'mat4x4']:
-        name = ('spec/glsl-1.20/compiler/built-in-functions/'
-                'outerProduct-{0}.vert'.format(type_))
+        name = os.path.join(dirname, 'outerProduct-{0}.vert'.format(type_))
         print(name)
         with open(name, 'w+') as f:
             f.write(template.render_unicode(type=type_))
-- 
2.1.3



More information about the Piglit mailing list