args to call_object must be tuple or NULL

This commit is contained in:
Guido van Rossum 1995-07-12 02:22:06 +00:00
parent b89ab8c6d2
commit 1311e3ce73
3 changed files with 7 additions and 17 deletions

View file

@ -344,11 +344,7 @@ instance_dealloc(inst)
INCREF(inst);
err_fetch(&error_type, &error_value, &error_traceback);
if ((del = instance_getattr1(inst, "__del__")) != NULL) {
object *args = newtupleobject(0);
object *res = args;
if (res != NULL)
res = call_object(del, args);
XDECREF(args);
object *res = call_object(del, (object *)NULL);
DECREF(del);
XDECREF(res);
/* XXX If __del__ raised an exception, it is ignored! */
@ -692,7 +688,7 @@ instance_item(inst, i)
func = instance_getattr(inst, "__getitem__");
if (func == NULL)
return NULL;
arg = newintobject((long)i);
arg = mkvalue("(i)", i);
if (arg == NULL) {
DECREF(func);
return NULL;