Skip to content

Commit

Permalink
Use exist_ok=True in makedirs instead of checking for existence first…
Browse files Browse the repository at this point in the history
…, in case of multiple concurrent processes (#212)

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
  • Loading branch information
emersonknapp authored Jul 24, 2024
1 parent 138e501 commit bfc22d5
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def run(output_file, yaml_file, validation_module=''):
print(f'Running {__file__} {output_file} {yaml_file} {validation_module}')
gen_param_struct = GenerateCode('python')
output_dir = os.path.dirname(output_file)
if not os.path.isdir(output_dir):
os.makedirs(output_dir)
os.makedirs(output_dir, exist_ok=True)

gen_param_struct.parse(yaml_file, validation_module)

Expand Down

0 comments on commit bfc22d5

Please sign in to comment.