mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
* 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:
parent
18fc5696c8
commit
d014ea6b5e
3 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue