summaryrefslogtreecommitdiff
path: root/Include/internal/pycore_object.h
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-05-01 19:36:00 -0600
committerGitHub <noreply@github.com>2023-05-01 19:36:00 -0600
commitfdd878650d325297cd801305bc2d1b0e903e42b4 (patch)
tree9814f09627ef014852dcc3fa462dfec30e5e591d /Include/internal/pycore_object.h
parentb1ca34d4d5e463b8108eea20090f12292390f0cf (diff)
downloadcpython-git-fdd878650d325297cd801305bc2d1b0e903e42b4.tar.gz
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.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h
index 2ca047846e..2ee0180c05 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():