summaryrefslogtreecommitdiff
path: root/test/sanity
diff options
context:
space:
mode:
authorMatt Davis <nitzmahone@users.noreply.github.com>2019-02-05 17:07:01 -0800
committerToshio Kuratomi <a.badger@gmail.com>2019-02-11 11:15:22 -0800
commit0708c80c409084604154ef4e844fe17034b933fc (patch)
tree24642345767737a000bdc0532c6d6cb799638cc9 /test/sanity
parent90203d0a1114fec449eccd38dcdb1cf0609bc1bf (diff)
downloadansible-0708c80c409084604154ef4e844fe17034b933fc.tar.gz
fix string_format sanity check (#51780)
* newer version of Pylint moved the impl; use conditional import to find for new/old (cherry picked from commit 6654c7aeea70a12fb848073ca3b0c377cf79e3d1)
Diffstat (limited to 'test/sanity')
-rw-r--r--test/sanity/pylint/plugins/string_format.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/sanity/pylint/plugins/string_format.py b/test/sanity/pylint/plugins/string_format.py
index c9808cf399..ed3918bb2e 100644
--- a/test/sanity/pylint/plugins/string_format.py
+++ b/test/sanity/pylint/plugins/string_format.py
@@ -13,7 +13,10 @@ from pylint.interfaces import IAstroidChecker
from pylint.checkers import BaseChecker
from pylint.checkers import utils
from pylint.checkers.utils import check_messages
-from pylint.checkers.strings import parse_format_method_string
+try:
+ from pylint.checkers.utils import parse_format_method_string
+except ImportError:
+ from pylint.checkers.strings import parse_format_method_string
_PY3K = sys.version_info[:2] >= (3, 0)