Close #20105: set __traceback__ when chaining exceptions in C

This commit is contained in:
Nick Coghlan 2014-01-27 00:53:38 +10:00
parent 23e37aa7b7
commit 77b286b2cc
5 changed files with 27 additions and 2 deletions

View file

@ -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