Skip to content

Commit bfc22d5

Browse files
authored
Use exist_ok=True in makedirs instead of checking for existence first, in case of multiple concurrent processes (#212)
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
1 parent 138e501 commit bfc22d5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

generate_parameter_library_py/generate_parameter_library_py/generate_python_module.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def run(output_file, yaml_file, validation_module=''):
4040
print(f'Running {__file__} {output_file} {yaml_file} {validation_module}')
4141
gen_param_struct = GenerateCode('python')
4242
output_dir = os.path.dirname(output_file)
43-
if not os.path.isdir(output_dir):
44-
os.makedirs(output_dir)
43+
os.makedirs(output_dir, exist_ok=True)
4544

4645
gen_param_struct.parse(yaml_file, validation_module)
4746

0 commit comments

Comments
 (0)