aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_abc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_abc.py')
-rw-r--r--Lib/test/test_abc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index 86f31a9acb4..5ce57cc209e 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -448,15 +448,16 @@ def test_factory(abc_ABCMeta, abc_get_cache_token):
# Also check that issubclass() propagates exceptions raised by
# __subclasses__.
+ class CustomError(Exception): ...
exc_msg = "exception from __subclasses__"
def raise_exc():
- raise Exception(exc_msg)
+ raise CustomError(exc_msg)
class S(metaclass=abc_ABCMeta):
__subclasses__ = raise_exc
- with self.assertRaisesRegex(Exception, exc_msg):
+ with self.assertRaisesRegex(CustomError, exc_msg):
issubclass(int, S)
def test_subclasshook(self):