Skip to content

Commit

Permalink
use exist_ok instead of explicit check for path exists when creating …
Browse files Browse the repository at this point in the history
…hash cache so it is multiprocess safe
  • Loading branch information
tclose committed Mar 17, 2024
1 parent 811dc45 commit f022435
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pydra/utils/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def location_converter(path: ty.Union[Path, str, None]) -> Path:
if path is None:
path = PersistentCache.location_default()
path = Path(path)
if not path.exists():
path.mkdir(parents=True)
path.mkdir(parents=True, exist_ok=True)
return path


Expand Down

0 comments on commit f022435

Please sign in to comment.