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)