mirror of
https://github.com/python/cpython.git
synced 2024-11-25 02:44:06 +08:00
Change error messages for impossible assignment slightly.
This commit is contained in:
parent
32dffaa016
commit
3ea7412d38
@ -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…
Reference in New Issue
Block a user