@@ -18,7 +18,7 @@ def __init__(self, field, value, expected_types):
1818 try :
1919 if len (expected_types ) == 1 :
2020 expected_types = expected_types [0 ]
21- except :
21+ except BaseException :
2222 pass
2323 self .expected_types = expected_types
2424
@@ -74,12 +74,12 @@ def assert_is_of_type(field, value, typ):
7474 else :
7575 # iterate and try them all
7676 e = None
77- for t in t_gen :
77+ for _t in t_gen :
7878 try :
7979 check_type (field .qualname , value , typ )
8080 return # success !!!!
81- except Exception as e :
82- pass # failed: lets try another one
81+ except Exception as e1 :
82+ e = e1 # failed: lets try another one
8383
8484 # raise from
8585 if e is not None :
@@ -131,7 +131,7 @@ def assert_is_of_type(field, value, typ):
131131 raise FieldTypeError (field , value , typ )
132132
133133 except ImportError :
134- from valid8 .utils .typing_inspect import is_typevar , is_union_type , get_args
134+ # from valid8.utils.typing_inspect import is_typevar, is_union_type, get_args
135135 from valid8 .utils .typing_tools import resolve_union_and_typevar
136136
137137 def assert_is_of_type (field , value , typ ):
@@ -164,7 +164,7 @@ def assert_is_of_type(field, value, typ):
164164
165165try : # very minimal way to check if typing it available, for runtime type checking
166166 # noinspection PyUnresolvedReferences
167- from typing import Tuple
167+ from typing import Tuple # noqa
168168 assert_is_of_type = _make_assert_is_of_type ()
169169except ImportError :
170170 assert_is_of_type = None
0 commit comments