Skip to content

Commit c4647ee

Browse files
committed
Use exist_ok in os.makedirs for json_save
Call os.makedirs(..., exist_ok=True) when ensuring the target directory for json_save
1 parent a8fbbf2 commit c4647ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backpack/json_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def json_save(data: dict, json_file: str) -> bool:
4040
"""
4141

4242
if not os.path.exists(os.path.dirname(json_file)):
43-
os.makedirs(os.path.dirname(json_file))
43+
os.makedirs(os.path.dirname(json_file), exist_ok=True)
4444

4545
try:
4646
with open(json_file, 'w') as f:

0 commit comments

Comments
 (0)