From 15aecf8dd70f82eb507d74fae9662072a377bdc8 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Wed, 4 Jan 2023 15:41:39 +0000 Subject: GH-100719: Remove the `co_nplaincellvars` field from code objects. (GH-100721) --- Python/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index cbbdfb9e94..c2e77fefb0 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2260,7 +2260,7 @@ compiler_make_closure(struct compiler *c, location loc, qualname = co->co_name; if (co->co_nfreevars) { - int i = co->co_nlocals + co->co_nplaincellvars; + int i = PyCode_GetFirstFree(co); for (; i < co->co_nlocalsplus; ++i) { /* Bypass com_addop_varname because it will generate LOAD_DEREF but LOAD_CLOSURE is needed. -- cgit v1.2.1