mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
gh-77757: replace exception wrapping by PEP-678 notes in typeobject's __set_name__ (#103402)
This commit is contained in:
parent
e071f00aae
commit
55c99d97e1
8 changed files with 55 additions and 41 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue