From e2b2e2b0ccf30ff3894318493c1eb93a4188f8ee Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Thu, 27 Apr 2023 17:42:37 -0600 Subject: [PATCH 1/2] Add a missing return statement. --- Objects/structseq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/structseq.c b/Objects/structseq.c index 727d72865e3bb3..88a71bc52958f5 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -31,6 +31,7 @@ get_type_attr_as_size(PyTypeObject *tp, PyObject *name) PyErr_Format(PyExc_TypeError, "Missed attribute '%U' of type %s", name, tp->tp_name); + return -1; } return PyLong_AsSsize_t(v); } From 655c12410e1f38021ba4d9528050b85d238f9384 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Thu, 27 Apr 2023 17:50:33 -0600 Subject: [PATCH 2/2] Run _PyTypes_InitTypes() for subinterpreters. --- Objects/object.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Objects/object.c b/Objects/object.c index cd610297aacba0..4ce10cf1192d3f 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2102,10 +2102,6 @@ static PyTypeObject* static_types[] = { PyStatus _PyTypes_InitTypes(PyInterpreterState *interp) { - if (!_Py_IsMainInterpreter(interp)) { - return _PyStatus_OK(); - } - // All other static types (unless initialized elsewhere) for (size_t i=0; i < Py_ARRAY_LENGTH(static_types); i++) { PyTypeObject *type = static_types[i];