mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-127190: Fix local_setattro() error handling (#127366)
Don't make the assumption that the 'name' argument is a string. Use repr() to format the 'name' argument instead.
This commit is contained in:
parent
49fee592a4
commit
20657fbdb1
2 changed files with 16 additions and 1 deletions
|
@ -1624,7 +1624,7 @@ local_setattro(localobject *self, PyObject *name, PyObject *v)
|
|||
}
|
||||
if (r == 1) {
|
||||
PyErr_Format(PyExc_AttributeError,
|
||||
"'%.100s' object attribute '%U' is read-only",
|
||||
"'%.100s' object attribute %R is read-only",
|
||||
Py_TYPE(self)->tp_name, name);
|
||||
goto err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue