Skip to content

Commit 8c7ef0f

Browse files
committed
if (type == NULL) continue;
1 parent dfe13a2 commit 8c7ef0f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Objects/object.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,7 +2671,10 @@ _PyTypes_InitTypes(PyInterpreterState *interp)
26712671
// All other static types (unless initialized elsewhere)
26722672
for (size_t i=0; i < Py_ARRAY_LENGTH(static_types); i++) {
26732673
PyTypeObject *type = static_types[i];
2674-
if (type && _PyStaticType_InitBuiltin(interp, type) < 0) {
2674+
if (type == NULL) {
2675+
continue;
2676+
}
2677+
if (_PyStaticType_InitBuiltin(interp, type) < 0) {
26752678
return _PyStatus_ERR("Can't initialize builtin type");
26762679
}
26772680
if (type == &PyType_Type) {
@@ -2711,9 +2714,10 @@ _PyTypes_FiniTypes(PyInterpreterState *interp)
27112714
// their base classes.
27122715
for (Py_ssize_t i=Py_ARRAY_LENGTH(static_types)-1; i>=0; i--) {
27132716
PyTypeObject *type = static_types[i];
2714-
if (type) {
2715-
_PyStaticType_FiniBuiltin(interp, type);
2717+
if (type == NULL) {
2718+
continue;
27162719
}
2720+
_PyStaticType_FiniBuiltin(interp, type);
27172721
}
27182722
}
27192723

0 commit comments

Comments
 (0)