mirror of https://github.com/python/cpython
If an attribute is deleted, __setattr__ is called with 2 instead of 3
arguments (adding __delattr__ was deemed too much overhead)
This commit is contained in:
parent
fda5fb2158
commit
91ab4a8353
|
@ -459,7 +459,11 @@ instance_setattr(inst, name, v)
|
|||
{
|
||||
object *ac;
|
||||
if (inst->in_setattr != NULL) {
|
||||
object *args = mkvalue("(sO)", name, v);
|
||||
object *args;
|
||||
if (v == NULL)
|
||||
args = mkvalue("(s)", name);
|
||||
else
|
||||
args = mkvalue("(sO)", name, v);
|
||||
if (args != NULL) {
|
||||
object *res = call_object(inst->in_setattr, args);
|
||||
DECREF(args);
|
||||
|
|
Loading…
Reference in New Issue