From 1311e3ce73263854e3899d14cc636ccfa166eebf Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 12 Jul 1995 02:22:06 +0000 Subject: args to call_object must be tuple or NULL --- Objects/object.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Objects/object.c') diff --git a/Objects/object.c b/Objects/object.c index d7110ae852..1643ec6fc1 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -177,7 +177,7 @@ strobject(v) { if (v == NULL) return newstringobject(""); - if (is_stringobject(v)) { + else if (is_stringobject(v)) { INCREF(v); return v; } @@ -185,19 +185,13 @@ strobject(v) return (*v->ob_type->tp_str)(v); else { object *func; - object *args; object *res; - if (!is_instanceobject(v) || (func = getattr(v, "__str__")) == NULL) { + if (!is_instanceobject(v) || + (func = getattr(v, "__str__")) == NULL) { err_clear(); return reprobject(v); } - args = newtupleobject(0); - if (args == NULL) - res = NULL; - else { - res = call_object(func, args); - DECREF(args); - } + res = call_object(func, (object *)NULL); DECREF(func); return res; } -- cgit v1.2.1