From 3e1a45683290ca7bb8a0ab2908b61c10f6a29d35 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Thu, 3 Nov 2022 18:00:04 +0900 Subject: [PATCH] fix: [E722](https://github.com/PyCQA/pycodestyle/blob/2.9.1/docs/intro.rst#error-codes) --- tests/legacy_tests/test_constructor.py | 2 +- tests/legacy_tests/test_multi_constructor.py | 4 ++-- tests/legacy_tests/test_schema.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/legacy_tests/test_constructor.py b/tests/legacy_tests/test_constructor.py index adcbb5cf..cc76a403 100644 --- a/tests/legacy_tests/test_constructor.py +++ b/tests/legacy_tests/test_constructor.py @@ -47,7 +47,7 @@ def my_time_constructor(constructor, node): tz = None try: tz = dt.tzinfo.tzname(dt) - except: + except Exception: pass return [dt, tz] diff --git a/tests/legacy_tests/test_multi_constructor.py b/tests/legacy_tests/test_multi_constructor.py index dcff2ce5..00060cbb 100644 --- a/tests/legacy_tests/test_multi_constructor.py +++ b/tests/legacy_tests/test_multi_constructor.py @@ -14,10 +14,10 @@ def myconstructor2(constructor, tag, node): string = '' try: i = tag.index('!') + 1 - except: + except Exception: try: i = tag.rindex(':') + 1 - except: + except Exception: pass if i >= 0: tag = tag[i:] diff --git a/tests/legacy_tests/test_schema.py b/tests/legacy_tests/test_schema.py index f3370ec1..0ce6574f 100644 --- a/tests/legacy_tests/test_schema.py +++ b/tests/legacy_tests/test_schema.py @@ -85,7 +85,7 @@ def test_implicit_resolver(data_filename, skip_filename, verbose=False): # Test loading try: loaded = yaml.safe_load(input) - except: + except Exception: print("Error:", sys.exc_info()[0], '(', sys.exc_info()[1], ')') fail+=1 _fail(input, test)