mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
gh-104602: ensure all cellvars are known up front (#104603)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
3fadd7d585
commit
86e6f16ccb
4 changed files with 50 additions and 22 deletions
|
@ -1252,7 +1252,7 @@ compiler_enter_scope(struct compiler *c, identifier name,
|
|||
}
|
||||
u->u_metadata.u_name = Py_NewRef(name);
|
||||
u->u_metadata.u_varnames = list2dict(u->u_ste->ste_varnames);
|
||||
u->u_metadata.u_cellvars = dictbytype(u->u_ste->ste_symbols, CELL, 0, 0);
|
||||
u->u_metadata.u_cellvars = dictbytype(u->u_ste->ste_symbols, CELL, DEF_COMP_CELL, 0);
|
||||
if (!u->u_metadata.u_varnames || !u->u_metadata.u_cellvars) {
|
||||
compiler_unit_free(u);
|
||||
return ERROR;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue