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 f725896
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mkdocs-include-markdown-plugin"
version = "7.1.0"
version = "7.1.1"
description = "Mkdocs Markdown includer plugin."
readme = "README.md"
license = "Apache-2.0"
Expand Down
13 changes: 6 additions & 7 deletions src/mkdocs_include_markdown_plugin/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
from importlib.util import find_spec


try:
platformdirs_spec = find_spec('platformdirs')
except ImportError: # pragma: no cover
CACHE_AVAILABLE = False
else:
CACHE_AVAILABLE = True
CACHE_AVAILABLE = find_spec('platformdirs') is not None


class Cache:
Expand Down Expand Up @@ -80,7 +75,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 f725896

Please sign in to comment.