Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 98e818b

Browse files
committed
Issue #19437: Fix compiler_class(), handle compiler_lookup_arg() failure
1 parent 357f515 commit 98e818b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Python/compile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,6 +1772,10 @@ compiler_class(struct compiler *c, stmt_ty s)
17721772
}
17731773
i = compiler_lookup_arg(c->u->u_cellvars, str);
17741774
Py_DECREF(str);
1775+
if (i < 0) {
1776+
compiler_exit_scope(c);
1777+
return 0;
1778+
}
17751779
assert(i == 0);
17761780
/* Return the cell where to store __class__ */
17771781
ADDOP_I(c, LOAD_CLOSURE, i);

0 commit comments

Comments
 (0)