Skip to content

Commit

Permalink
Fix error checking dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Nov 21, 2024
1 parent 4948835 commit 8d78e66
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mkdocs_include_markdown_plugin/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
except ImportError: # pragma: no cover
CACHE_AVAILABLE = False
else:
CACHE_AVAILABLE = True
CACHE_AVAILABLE = platformdirs_spec is not None


class Cache:
Expand Down Expand Up @@ -80,7 +80,11 @@ def get_cache_directory() -> str | None:
if not CACHE_AVAILABLE:
return None

from platformdirs import user_data_dir
try:
from platformdirs import user_data_dir
except ImportError:
return None

cache_dir = user_data_dir('mkdocs-include-markdown-plugin')
os.makedirs(cache_dir, exist_ok=True)

Expand Down

0 comments on commit 8d78e66

Please sign in to comment.