mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.12] GH-106898: Add the exception as an argument to the PY_UNWIND
event callback function. (GH-107347) (GH-107382)
This commit is contained in:
parent
0902afbae2
commit
3f167de440
4 changed files with 29 additions and 6 deletions
|
@ -715,7 +715,7 @@ class CheckEvents(MonitoringTestBase, unittest.TestCase):
|
|||
self.assertIn(r0, ("raise", "reraise"))
|
||||
h0 = h[0]
|
||||
self.assertIn(h0, ("handled", "unwind"))
|
||||
|
||||
self.assertEqual(r[1], h[1])
|
||||
|
||||
|
||||
class StopiterationRecorder(ExceptionRecorder):
|
||||
|
@ -733,8 +733,8 @@ class UnwindRecorder(ExceptionRecorder):
|
|||
|
||||
event_type = E.PY_UNWIND
|
||||
|
||||
def __call__(self, *args):
|
||||
self.events.append(("unwind", None))
|
||||
def __call__(self, code, offset, exc):
|
||||
self.events.append(("unwind", type(exc)))
|
||||
|
||||
class ExceptionHandledRecorder(ExceptionRecorder):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue