mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
GH-106898: Add the exception as an argument to the PY_UNWIND
event callback function. (GH-107347)
This commit is contained in:
parent
9a7204b86b
commit
ac7a0f858a
4 changed files with 29 additions and 6 deletions
|
@ -64,6 +64,16 @@ sys_profile_func3(
|
|||
return call_profile_func(self, args[2]);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
sys_profile_unwind(
|
||||
_PyLegacyEventHandler *self, PyObject *const *args,
|
||||
size_t nargsf, PyObject *kwnames
|
||||
) {
|
||||
assert(kwnames == NULL);
|
||||
assert(PyVectorcall_NARGS(nargsf) == 3);
|
||||
return call_profile_func(self, Py_None);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
sys_profile_call_or_return(
|
||||
_PyLegacyEventHandler *self, PyObject *const *args,
|
||||
|
@ -152,6 +162,16 @@ sys_trace_func2(
|
|||
return call_trace_func(self, Py_None);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
sys_trace_unwind(
|
||||
_PyLegacyEventHandler *self, PyObject *const *args,
|
||||
size_t nargsf, PyObject *kwnames
|
||||
) {
|
||||
assert(kwnames == NULL);
|
||||
assert(PyVectorcall_NARGS(nargsf) == 3);
|
||||
return call_trace_func(self, Py_None);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
sys_trace_return(
|
||||
_PyLegacyEventHandler *self, PyObject *const *args,
|
||||
|
@ -362,7 +382,7 @@ _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
|
|||
return -1;
|
||||
}
|
||||
if (set_callbacks(PY_MONITORING_SYS_PROFILE_ID,
|
||||
(vectorcallfunc)sys_profile_func2, PyTrace_RETURN,
|
||||
(vectorcallfunc)sys_profile_unwind, PyTrace_RETURN,
|
||||
PY_MONITORING_EVENT_PY_UNWIND, -1)) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -450,7 +470,7 @@ _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
|
|||
return -1;
|
||||
}
|
||||
if (set_callbacks(PY_MONITORING_SYS_TRACE_ID,
|
||||
(vectorcallfunc)sys_trace_func2, PyTrace_RETURN,
|
||||
(vectorcallfunc)sys_trace_unwind, PyTrace_RETURN,
|
||||
PY_MONITORING_EVENT_PY_UNWIND, -1)) {
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue