diff --git a/Include/cpython/funcobject.h b/Include/cpython/funcobject.h index 23c8009c38d..a6cec5f31cf 100644 --- a/Include/cpython/funcobject.h +++ b/Include/cpython/funcobject.h @@ -139,7 +139,8 @@ PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *); V(DESTROY) \ V(MODIFY_CODE) \ V(MODIFY_DEFAULTS) \ - V(MODIFY_KWDEFAULTS) + V(MODIFY_KWDEFAULTS) \ + V(MODIFY_QUALNAME) typedef enum { #define PY_DEF_EVENT(EVENT) PyFunction_EVENT_##EVENT, diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 0efcddf4319..4c7c42eb1ce 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -541,6 +541,8 @@ func_set_qualname(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored "__qualname__ must be set to a string object"); return -1; } + handle_func_event(PyFunction_EVENT_MODIFY_QUALNAME, + (PyFunctionObject *)op, value); Py_XSETREF(op->func_qualname, Py_NewRef(value)); return 0; }