From 43725647cc232fd50ebe5a51db28c76402183c37 Mon Sep 17 00:00:00 2001 From: Jason White Date: Tue, 23 May 2017 18:56:02 -0400 Subject: [PATCH] bump to pylint 1.7.1 --- setup.py | 2 +- shopify_python/google_styleguide.py | 4 ++-- shopify_python/shopify_styleguide.py | 2 +- tests/shopify_python/test_google_styleguide.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index ad3d9af..3933b2b 100755 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ def get_version(): test_suite='tests', install_requires=[ 'GitPython>=2.1.1,<3', - 'pylint>=1.6.5,<1.7', + 'pylint>=1.7.1,<1.8', 'six>=1.10.0,<2', 'typing>=3.5.3.0,<4', 'autopep8>=1.2.2,<2', diff --git a/shopify_python/google_styleguide.py b/shopify_python/google_styleguide.py index 42e3129..059f00e 100644 --- a/shopify_python/google_styleguide.py +++ b/shopify_python/google_styleguide.py @@ -185,8 +185,8 @@ def __import_modules_only(self, node): # type: (astroid.ImportFrom) -> None args = {'child': child_module} try: parent.import_module(child_module) - except astroid.exceptions.AstroidBuildingException as building_exception: - if str(building_exception).startswith('Unable to load module'): + except astroid.exceptions.AstroidImportError as building_exception: + if str(building_exception).startswith('Failed to import module'): self.add_message('import-modules-only', node=node, args=args) else: raise diff --git a/shopify_python/shopify_styleguide.py b/shopify_python/shopify_styleguide.py index e5e3aaf..f3937e9 100644 --- a/shopify_python/shopify_styleguide.py +++ b/shopify_python/shopify_styleguide.py @@ -41,7 +41,7 @@ def process_tokens(self, tokens): def get_name(code): try: return self.linter.msgs_store.get_msg_display_string(code) - except pylint.utils.UnknownMessage: + except pylint.utils.UnknownMessageError: return 'unknown' matches = self.RE_PYLINT_DISABLE.match(string) diff --git a/tests/shopify_python/test_google_styleguide.py b/tests/shopify_python/test_google_styleguide.py index 5d76fc1..d1b5327 100644 --- a/tests/shopify_python/test_google_styleguide.py +++ b/tests/shopify_python/test_google_styleguide.py @@ -20,7 +20,7 @@ def assert_adds_code_messages(self, codes, *messages): msg = ('Expected messages did not match actual.\n' 'Expected:\n%s\nGot:\n%s' % ('\n'.join(repr(m) for m in messages), '\n'.join(repr(m) for m in got))) - self.assertEqual(list(messages), got, msg) + assert list(messages) == got, msg def test_importing_function_fails(self): root = astroid.builder.parse("""