diff --git a/Objects/classobject.c b/Objects/classobject.c index b8b72e9fd94..a05c0bf368d 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -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);