diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-05-02 01:36:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 01:36:00 (GMT) |
commit | fdd878650d325297cd801305bc2d1b0e903e42b4 (patch) | |
tree | 9814f09627ef014852dcc3fa462dfec30e5e591d /Include/internal/pycore_object.h | |
parent | b1ca34d4d5e463b8108eea20090f12292390f0cf (diff) | |
download | cpython-fdd878650d325297cd801305bc2d1b0e903e42b4.zip cpython-fdd878650d325297cd801305bc2d1b0e903e42b4.tar.gz cpython-fdd878650d325297cd801305bc2d1b0e903e42b4.tar.bz2 |
gh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (gh-104072)
Until now, we haven't been initializing nor finalizing the per-interpreter state properly.
Diffstat (limited to 'Include/internal/pycore_object.h')
-rw-r--r-- | Include/internal/pycore_object.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 2ca0478..2ee0180 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -272,8 +272,9 @@ _PyObject_GET_WEAKREFS_LISTPTR(PyObject *op) { if (PyType_Check(op) && ((PyTypeObject *)op)->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN) { + PyInterpreterState *interp = _PyInterpreterState_GET(); static_builtin_state *state = _PyStaticType_GetState( - (PyTypeObject *)op); + interp, (PyTypeObject *)op); return _PyStaticType_GET_WEAKREFS_LISTPTR(state); } // Essentially _PyObject_GET_WEAKREFS_LISTPTR_FROM_OFFSET(): |