PEP 415: Implement suppression of __context__ display with an exception attribute
This replaces the original PEP 409 implementation. See #14133.
diff --git a/Lib/test/test_raise.py b/Lib/test/test_raise.py
index 8ae9210..b169867 100644
--- a/Lib/test/test_raise.py
+++ b/Lib/test/test_raise.py
@@ -174,11 +174,14 @@
raise ValueError from None
except ValueError as exc:
self.assertIsNone(exc.__cause__)
- raise exc from Ellipsis
+ self.assertTrue(exc.__suppress_context__)
+ exc.__suppress_context__ = False
+ raise exc
except ValueError as exc:
e = exc
- self.assertIs(e.__cause__, Ellipsis)
+ self.assertIsNone(e.__cause__)
+ self.assertFalse(e.__suppress_context__)
self.assertIsInstance(e.__context__, TypeError)
def test_invalid_cause(self):