mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Close #20105: set __traceback__ when chaining exceptions in C
This commit is contained in:
parent
23e37aa7b7
commit
77b286b2cc
5 changed files with 27 additions and 2 deletions
|
@ -2522,6 +2522,7 @@ class ExceptionChainingTest(unittest.TestCase):
|
|||
with self.assertRaisesRegex(exc_type, full_msg) as caught:
|
||||
yield caught
|
||||
self.assertIsInstance(caught.exception.__cause__, exc_type)
|
||||
self.assertIsNotNone(caught.exception.__cause__.__traceback__)
|
||||
|
||||
def raise_obj(self, *args, **kwds):
|
||||
# Helper to dynamically change the object raised by a test codec
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue