From d42227456338c3042eddb8f4a64c205791a5463f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Fri, 27 Oct 2017 17:18:32 +0200 Subject: [PATCH] style: Fix E722 errors reported by pycodestyle Since a few days ago pycodestyle (formerly called pep8) has a new check: E722 warning for bare except clauses. Let's fix our code. --- tests/common.py | 2 +- tests/test_cli.py | 2 +- tests/test_config.py | 2 +- tests/test_linter.py | 2 +- tests/test_module.py | 2 +- tests/test_parser.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/common.py b/tests/common.py index 11dd235..ddeb867 100644 --- a/tests/common.py +++ b/tests/common.py @@ -20,7 +20,7 @@ import sys try: assert sys.version_info >= (2, 7) import unittest -except: +except AssertionError: import unittest2 as unittest import yaml diff --git a/tests/test_cli.py b/tests/test_cli.py index bec7078..e903d57 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -27,7 +27,7 @@ import sys try: assert sys.version_info >= (2, 7) import unittest -except: +except AssertionError: import unittest2 as unittest from yamllint import cli diff --git a/tests/test_config.py b/tests/test_config.py index a23da10..7e719b1 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -24,7 +24,7 @@ import sys try: assert sys.version_info >= (2, 7) import unittest -except: +except AssertionError: import unittest2 as unittest from yamllint import cli diff --git a/tests/test_linter.py b/tests/test_linter.py index edd803f..6c7ae62 100644 --- a/tests/test_linter.py +++ b/tests/test_linter.py @@ -19,7 +19,7 @@ import sys try: assert sys.version_info >= (2, 7) import unittest -except: +except AssertionError: import unittest2 as unittest from yamllint.config import YamlLintConfig diff --git a/tests/test_module.py b/tests/test_module.py index 678f40c..e7c78b3 100644 --- a/tests/test_module.py +++ b/tests/test_module.py @@ -22,7 +22,7 @@ import sys try: assert sys.version_info >= (2, 7) import unittest -except: +except AssertionError: import unittest2 as unittest diff --git a/tests/test_parser.py b/tests/test_parser.py index c5c51d8..7ed1f98 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -18,7 +18,7 @@ import sys try: assert sys.version_info >= (2, 7) import unittest -except: +except AssertionError: import unittest2 as unittest import yaml