Skip to content

Commit 7ba52d6

Browse files
authored
Use packaging Version to compare versions, closes #135
1 parent 01e81f8 commit 7ba52d6

File tree

1 file changed

+3
-1
lines changed
  • mkdocs_git_revision_date_localized_plugin

1 file changed

+3
-1
lines changed

mkdocs_git_revision_date_localized_plugin/plugin.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
from typing import Any, Dict
2323
from collections import OrderedDict
2424

25+
from packaging.version import Version
26+
2527
HERE = os.path.dirname(os.path.abspath(__file__))
2628

2729
class GitRevisionDateLocalizedPlugin(BasePlugin):
@@ -76,7 +78,7 @@ def on_config(self, config: config_options.Config, **kwargs) -> Dict[str, Any]:
7678
# theme locale
7779
if "theme" in config and "locale" in config.get("theme"):
7880
custom_theme = config.get("theme")
79-
theme_locale = custom_theme.locale if mkdocs_version >= "1.6.0" else custom_theme._vars.get("locale")
81+
theme_locale = custom_theme.locale if Version(mkdocs_version) >= Version("1.6.0") else custom_theme._vars.get("locale")
8082
logging.debug(
8183
"Locale '%s' extracted from the custom theme: '%s'"
8284
% (theme_locale, custom_theme.name)

0 commit comments

Comments
 (0)