From a6a257b9c722eaa5af68e0ac6797a6604d71e19e Mon Sep 17 00:00:00 2001 From: maxhipperson <40496579+maxhipperson@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:24:36 +0000 Subject: [PATCH] Allow preexisting directories in the cache path --- uhura/caches.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uhura/caches.py b/uhura/caches.py index 68166a6..cec646a 100644 --- a/uhura/caches.py +++ b/uhura/caches.py @@ -50,7 +50,7 @@ def update(self, obj): logger.info(f"Dumping to {self._path}") if not os.path.exists(os.path.dirname(self._path)): - os.makedirs(os.path.dirname(self._path)) + os.makedirs(os.path.dirname(self._path), exist_ok=True) self._serde.write_to_file(self._path, obj) return obj