mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Change error messages for impossible assignment slightly.
This commit is contained in:
parent
32dffaa016
commit
3ea7412d38
1 changed files with 4 additions and 2 deletions
|
|
@ -169,9 +169,11 @@ setattr(v, name, w)
|
|||
{
|
||||
if (v->ob_type->tp_setattr == NULL) {
|
||||
if (v->ob_type->tp_getattr == NULL)
|
||||
err_setstr(TypeError, "attribute-less object");
|
||||
err_setstr(TypeError,
|
||||
"attribute-less object (assign or del)");
|
||||
else
|
||||
err_setstr(TypeError, "object has read-only attributes");
|
||||
err_setstr(TypeError,
|
||||
"object has read-only attributes");
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue