summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c2
1 files changed, 1 insertions, 1 deletions
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.