gh-77757: replace exception wrapping by PEP-678 notes in typeobject's __set_name__ (#103402)

This commit is contained in:
Irit Katriel 2023-04-11 11:53:06 +01:00 committed by GitHub
parent e071f00aae
commit 55c99d97e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 55 additions and 41 deletions

View file

@ -9137,13 +9137,15 @@ type_new_set_names(PyTypeObject *type)
Py_DECREF(set_name);
if (res == NULL) {
_PyErr_FormatFromCause(PyExc_RuntimeError,
_PyErr_FormatNote(
"Error calling __set_name__ on '%.100s' instance %R "
"in '%.100s'",
Py_TYPE(value)->tp_name, key, type->tp_name);
goto error;
}
Py_DECREF(res);
else {
Py_DECREF(res);
}
}
Py_DECREF(names_to_set);