Skip to content

Commit 424a785

Browse files
gh-94673: Fix _PyTypes_InitTypes() and get_type_attr_as_size() (gh-103961)
This change has two small parts: 1. a follow-up to gh-103940 with one case I missed 2. adding a missing return that I noticed while working on related code
1 parent d2e2e53 commit 424a785

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

Objects/object.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,10 +2102,6 @@ static PyTypeObject* static_types[] = {
21022102
PyStatus
21032103
_PyTypes_InitTypes(PyInterpreterState *interp)
21042104
{
2105-
if (!_Py_IsMainInterpreter(interp)) {
2106-
return _PyStatus_OK();
2107-
}
2108-
21092105
// All other static types (unless initialized elsewhere)
21102106
for (size_t i=0; i < Py_ARRAY_LENGTH(static_types); i++) {
21112107
PyTypeObject *type = static_types[i];

Objects/structseq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ get_type_attr_as_size(PyTypeObject *tp, PyObject *name)
3131
PyErr_Format(PyExc_TypeError,
3232
"Missed attribute '%U' of type %s",
3333
name, tp->tp_name);
34+
return -1;
3435
}
3536
return PyLong_AsSsize_t(v);
3637
}

0 commit comments

Comments
 (0)