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:
Guido van Rossum 1994-08-16 22:13:47 +00:00
parent fda5fb2158
commit 91ab4a8353
1 changed files with 5 additions and 1 deletions

View File

@ -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);