diff options
author | Mark Shannon <mark@hotpy.org> | 2023-01-04 15:41:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-04 15:41:39 +0000 |
commit | 15aecf8dd70f82eb507d74fae9662072a377bdc8 (patch) | |
tree | 6afd6d35744428bafd5b64bc6fccbb830534c86e /Python/ceval.c | |
parent | c31e356a10aa60b5967b9aaf80b9984059e46461 (diff) | |
download | cpython-git-15aecf8dd70f82eb507d74fae9662072a377bdc8.tar.gz |
GH-100719: Remove the `co_nplaincellvars` field from code objects. (GH-100721)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 45f42800d7..54df1c5125 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3417,7 +3417,7 @@ format_exc_unbound(PyThreadState *tstate, PyCodeObject *co, int oparg) if (_PyErr_Occurred(tstate)) return; name = PyTuple_GET_ITEM(co->co_localsplusnames, oparg); - if (oparg < co->co_nplaincellvars + co->co_nlocals) { + if (oparg < PyCode_GetFirstFree(co)) { format_exc_check_arg(tstate, PyExc_UnboundLocalError, UNBOUNDLOCAL_ERROR_MSG, name); } else { |