diff --git a/utils/mdakit.py b/utils/mdakit.py index 3d166ac5..93892351 100644 --- a/utils/mdakit.py +++ b/utils/mdakit.py @@ -261,9 +261,11 @@ def get_matching_version(self, max_ver: str = "3.11", min_ver: str = "3.8", while (current_version.to_version() >= min_version.to_version()): for spec in pin_specifiers: + # Fetch the pin version string and convert it for comparison + pin_ver = version.TargetVersion.from_str(spec.version) compatible_version = version._operators[spec.operator]( - current_version.to_string(), - spec.version, + current_version.to_version(), + pin_ver.to_version(), ) if compatible_version: