From b71133eeb5cc330abb9618c4aa7e0ad7fa94886d Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 25 Apr 2019 09:22:32 -0700 Subject: [PATCH] Use LooseVersion instead of StrictVersion as StrictVersion doesn't understand "rc1" --- test/sanity/pylint/plugins/deprecated.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sanity/pylint/plugins/deprecated.py b/test/sanity/pylint/plugins/deprecated.py index c61392e61f2..10240d3d7da 100644 --- a/test/sanity/pylint/plugins/deprecated.py +++ b/test/sanity/pylint/plugins/deprecated.py @@ -4,7 +4,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from distutils.version import StrictVersion +from distutils.version import LooseVersion import astroid @@ -35,7 +35,7 @@ MSGS = { } -ANSIBLE_VERSION = StrictVersion('.'.join(ansible_version_raw.split('.')[:3])) +ANSIBLE_VERSION = LooseVersion('.'.join(ansible_version_raw.split('.')[:3])) def _get_expr_name(node): @@ -83,7 +83,7 @@ class AnsibleDeprecatedChecker(BaseChecker): return try: - if ANSIBLE_VERSION >= StrictVersion(str(version)): + if ANSIBLE_VERSION >= LooseVersion(str(version)): self.add_message('ansible-deprecated-version', node=node, args=(version,)) except ValueError: self.add_message('ansible-invalid-deprecated-version', node=node, args=(version,))