bug 1403040 - fix queuedir in multiprocessing tests. r=rail
authorAki Sasaki <asasaki@mozilla.com>
Mon, 02 Oct 2017 11:23:09 -0700
changeset 7903 beb6986d4815
parent 7902 aeca53320ba0
child 7904 af8b60f21ca8
push id5841
push userasasaki@mozilla.com
push dateMon, 02 Oct 2017 18:23:15 +0000
reviewersrail
bugs1403040
bug 1403040 - fix queuedir in multiprocessing tests. r=rail
lib/python/mozilla_buildtools/queuedir.py
--- a/lib/python/mozilla_buildtools/queuedir.py
+++ b/lib/python/mozilla_buildtools/queuedir.py
@@ -55,19 +55,23 @@ class QueueDir(object):
     def setup(self):
         for d in (self.tmp_dir, self.new_dir, self.cur_dir, self.log_dir, self.dead_dir):
             # Create our directories a bit at a time so we can make sure the
             # modes are created properly
             parts = d.split("/")
             path = "/"
             for p in parts:
                 path = os.path.join(path, p)
-                if not os.path.exists(path):
+                try:
                     os.mkdir(path)
                     os.chmod(path, 0755)
+                except OSError:
+                    pass
+            if not os.path.isdir(d):
+                raise OSError("Can't create %s" % d)
 
         self.cleanup()
 
     def cleanup(self):
         """
         Removes old items from tmp
         Removes old logs from log_dir
         Moves old items from cur into new