summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-16 22:13:47 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-16 22:13:47 (GMT)
commit91ab4a8353447f265a7559a4769ac5404bb0b157 (patch)
tree538dde2f6a607c010787abca3199aae8ead2b3ea /Objects/classobject.c
parentfda5fb21583934d4a82f61e58a6706eeda0aca87 (diff)
downloadcpython-91ab4a8353447f265a7559a4769ac5404bb0b157.zip
cpython-91ab4a8353447f265a7559a4769ac5404bb0b157.tar.gz
cpython-91ab4a8353447f265a7559a4769ac5404bb0b157.tar.bz2
If an attribute is deleted, __setattr__ is called with 2 instead of 3
arguments (adding __delattr__ was deemed too much overhead)
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index b8b72e9..a05c0bf 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);