Remove references to old-style classes in a couple error messages

These don't exist in Python 3.
This commit is contained in:
Ran Benita 2019-07-10 13:27:28 +03:00
parent 602cd5e21f
commit f7747f5dd6
2 changed files with 2 additions and 5 deletions

View File

@ -647,10 +647,7 @@ def raises(expected_exception, *args, match=None, **kwargs):
for exc in filterfalse(
inspect.isclass, always_iterable(expected_exception, BASE_TYPE)
):
msg = (
"exceptions must be old-style classes or"
" derived from BaseException, not %s"
)
msg = "exceptions must be derived from BaseException, not %s"
raise TypeError(msg % type(exc))
message = "DID NOT RAISE {}".format(expected_exception)

View File

@ -151,7 +151,7 @@ class WarningsChecker(WarningsRecorder):
def __init__(self, expected_warning=None, match_expr=None):
super().__init__()
msg = "exceptions must be old-style classes or derived from Warning, not %s"
msg = "exceptions must be derived from Warning, not %s"
if isinstance(expected_warning, tuple):
for exc in expected_warning:
if not inspect.isclass(exc):