Avoid a race condition when making directories

This can happen when doing a concurrent build with -jX.
This commit is contained in:
John Wiegley 2009-03-08 18:46:25 -04:00
parent 7b2d75904c
commit 6154b9e794

View file

@ -42,7 +42,8 @@ target = os.path.abspath(sys.argv[2])
dirname = os.path.dirname(target) dirname = os.path.dirname(target)
if not os.path.isdir(dirname): if not os.path.isdir(dirname):
os.makedirs(dirname) try: os.makedirs(dirname)
except: pass
fd = open(source, "r") fd = open(source, "r")
fo = open(target, "w") fo = open(target, "w")