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).
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)
return NULL;
}
n = (*sq->sq_length)(v);
+ if (n < 0)
+ return NULL;
if (n == 0) {
err_setstr(ValueError, "min() or max() of empty sequence");
return NULL;
}
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);