Skip to content

Commit 71b975e

Browse files
[HOTFIX] fix race condition in benchmark output directory creation
Use os.makedirs(exist_ok=True) to avoid FileExistsError when parallel Sphinx-Gallery examples concurrently create the output directory.
1 parent fed921a commit 71b975e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

moabb/benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ def benchmark( # noqa: C901
205205
# logging.basicConfig(level=logging.WARNING)
206206

207207
output = Path(output)
208-
if not osp.isdir(output):
209-
os.makedirs(output)
208+
os.makedirs(output, exist_ok=True)
210209

211210
if isinstance(pipelines, str):
212211
pipeline_configs = parse_pipelines_from_directory(pipelines)

0 commit comments

Comments
 (0)