summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-11-26 10:30:26 (GMT)
committerGuido van Rossum <guido@python.org>1992-11-26 10:30:26 (GMT)
commitd014ea6b5efbfb3d143fc8aacf8bee733cf4c8f0 (patch)
treedc0e77dcbbf8da041a72226eda0aefbc849cd6eb /Objects
parent18fc5696c8be30b56485a20dc48f7f683b472f79 (diff)
downloadcpython-d014ea6b5efbfb3d143fc8aacf8bee733cf4c8f0.zip
cpython-d014ea6b5efbfb3d143fc8aacf8bee733cf4c8f0.tar.gz
cpython-d014ea6b5efbfb3d143fc8aacf8bee733cf4c8f0.tar.bz2
* 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).
Diffstat (limited to 'Objects')
-rw-r--r--Objects/classobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index e3b12c6..0661e81 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)