* 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).
This commit is contained in:
@@ -412,6 +412,8 @@ min_max(v, sign)
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user