Skip to content

Commit af539d8

Browse files
Fix race in os.makedirs
1 parent 9eae252 commit af539d8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

test/core/run.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def _runTestFile(self, inputPath):
113113

114114

115115
if __name__ == "__main__":
116-
if not os.path.exists(outputDir):
117-
os.makedirs(outputDir)
116+
os.makedirs(outputDir, exist_ok=True)
118117
for fileName in inputFiles:
119118
testName = 'test ' + os.path.basename(fileName)
120119
setattr(RunTests, testName, lambda self, file=fileName: self._runTestFile(file))

0 commit comments

Comments
 (0)