mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #19437: Fix compiler_class(), handle compiler_lookup_arg() failure
This commit is contained in:
parent
357f5155dc
commit
98e818b8e3
1 changed files with 4 additions and 0 deletions
|
@ -1772,6 +1772,10 @@ compiler_class(struct compiler *c, stmt_ty s)
|
||||||
}
|
}
|
||||||
i = compiler_lookup_arg(c->u->u_cellvars, str);
|
i = compiler_lookup_arg(c->u->u_cellvars, str);
|
||||||
Py_DECREF(str);
|
Py_DECREF(str);
|
||||||
|
if (i < 0) {
|
||||||
|
compiler_exit_scope(c);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
assert(i == 0);
|
assert(i == 0);
|
||||||
/* Return the cell where to store __class__ */
|
/* Return the cell where to store __class__ */
|
||||||
ADDOP_I(c, LOAD_CLOSURE, i);
|
ADDOP_I(c, LOAD_CLOSURE, i);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue