Skip to content

Commit 359653a

Browse files
Max Blackmer, CSMkvesteri
authored andcommitted
Fix for TypeError in python 3.7 (#113)
pytest with throw this error when running in version 3.7: "TypeError: catching classes that do not inherit from BaseException is not allowed" Changing the inheritance from object to Exception will fix this and is compatible back to version 2.7 and should cause no issues. This pytest sample test that will trigger the error in python 3.7: def test_init_with_bad_url(self): with pytest.raises(validators.ValidationFailure): assert True
1 parent fc0eeae commit 359653a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validators/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from decorator import decorator
77

88

9-
class ValidationFailure(object):
9+
class ValidationFailure(Exception):
1010
def __init__(self, func, args):
1111
self.func = func
1212
self.__dict__.update(args)

0 commit comments

Comments
 (0)