summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-09-08 09:34:40 (GMT)
committerGitHub <noreply@github.com>2023-09-08 09:34:40 (GMT)
commit15d4c9fabce67b8a1b5bd9dec9612014ec18291a (patch)
tree1c728c98663c224ec93022b0bdd0dd685c9fdf38 /Objects/codeobject.c
parent00cf626cd41f806062c22a913b647b4efa84c476 (diff)
downloadcpython-15d4c9fabce67b8a1b5bd9dec9612014ec18291a.zip
cpython-15d4c9fabce67b8a1b5bd9dec9612014ec18291a.tar.gz
cpython-15d4c9fabce67b8a1b5bd9dec9612014ec18291a.tar.bz2
GH-108716: Turn off deep-freezing of code objects. (GH-108722)
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 1443027..d00bd04 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -427,9 +427,10 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
co->co_framesize = nlocalsplus + con->stacksize + FRAME_SPECIALS_SIZE;
co->co_ncellvars = ncellvars;
co->co_nfreevars = nfreevars;
- co->co_version = _Py_next_func_version;
- if (_Py_next_func_version != 0) {
- _Py_next_func_version++;
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ co->co_version = interp->next_func_version;
+ if (interp->next_func_version != 0) {
+ interp->next_func_version++;
}
co->_co_monitoring = NULL;
co->_co_instrumentation_version = 0;