diff Python/ceval.c @ 1096:ce718457b172 legacy-trunk

* 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).
author Guido van Rossum <guido@python.org>
date Thu, 26 Nov 1992 10:30:26 +0000
parents e4c6a0dd5c2b
children 6461dac9a9f2
line wrap: on
line diff
--- a/Python/ceval.c	Thu Nov 26 09:17:19 1992 +0000
+++ b/Python/ceval.c	Thu Nov 26 10:30:26 1992 +0000
@@ -1881,6 +1881,8 @@
 	}
 	i = getintvalue(w);
 	n = (*sq->sq_length)(v);
+	if (n < 0)
+		return NULL; /* Exception */
 	if (i >= n)
 		return NULL; /* End of loop */
 	return (*sq->sq_item)(v, i);