-
Dylan Baker authored
Currently we check for the existence of a directory, and if it doesn't exist we create it. This would be fine, except that multiple generators can create the same directory trees. When os.makedirs tries to create a tree that already exists it raises and OSError exception, with the errno set to 17 (the File Exists Error). Since between the time that a check is made and the time the os.makedirs completes a second generator can create the directory tree we can have exceptions raised sporadically, especially as the number of threads being used to generate goes up. We maintain the check for existence before trying to create the directories because os.makedirs is slow, so not even trying is better than trying in vain. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
b59ff71e