[Piglit] [PATCH 2/9] gen_tess_input_tests.py: use modules.utils.safe_makedirs

Dylan Baker baker.dylan.c at gmail.com
Wed Oct 7 14:26:14 PDT 2015


This if much like os.makedirs, but catches extra errors to handle corner
cases.

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

diff --git a/generated_tests/gen_tess_input_tests.py b/generated_tests/gen_tess_input_tests.py
index bb23f8d..e0c2ac6 100644
--- a/generated_tests/gen_tess_input_tests.py
+++ b/generated_tests/gen_tess_input_tests.py
@@ -37,6 +37,8 @@ import textwrap
 
 from six.moves import range
 
+from modules.utils import safe_makedirs
+
 
 class TcsTest(object):
     """Test passing variables from the vertex shader to the tessellation
@@ -283,8 +285,7 @@ class TcsTest(object):
 
         filename = self.filename()
         dirname = os.path.dirname(filename)
-        if not os.path.exists(dirname):
-            os.makedirs(dirname)
+        safe_makedirs(dirname)
         with open(filename, 'w') as f:
             f.write(test)
 
@@ -561,8 +562,7 @@ class TesTest(object):
 
         filename = self.filename()
         dirname = os.path.dirname(filename)
-        if not os.path.exists(dirname):
-            os.makedirs(dirname)
+        safe_makedirs(dirname)
         with open(filename, 'w') as f:
             f.write(test)
 
-- 
2.6.1



More information about the Piglit mailing list