diff --git a/src/fcache/cache.py b/src/fcache/cache.py index ebafa01..53326af 100644 --- a/src/fcache/cache.py +++ b/src/fcache/cache.py @@ -139,8 +139,7 @@ def create(self): """Create the write buffer and cache directory.""" if not self._sync and not hasattr(self, "_buffer"): self._buffer = {} - if not os.path.exists(self.cache_dir): - os.makedirs(self.cache_dir) + os.makedirs(self.cache_dir, exist_ok=True) def clear(self): """Remove all items from the write buffer and cache.