From d014ea6b5efbfb3d143fc8aacf8bee733cf4c8f0 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 26 Nov 1992 10:30:26 +0000 Subject: * classobject.c: in instance_lenth, test result of call_object for exception before using it. Fixed a few other places where the outcome of calling sq_length wasn't tested for exceptions (bltinmodule.c, ceval.c). --- Objects/classobject.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Objects/classobject.c') diff --git a/Objects/classobject.c b/Objects/classobject.c index e3b12c68f6..0661e810c8 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -324,6 +324,8 @@ instance_length(inst) return -1; res = call_object(func, (object *)NULL); DECREF(func); + if (res == NULL) + return -1; if (is_intobject(res)) { outcome = getintvalue(res); if (outcome < 0) -- cgit v1.2.1