mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Use the new Py_ARRAY_LENGTH macro
This commit is contained in:
parent
b9dcffb51e
commit
639418812f
15 changed files with 26 additions and 28 deletions
|
@ -2355,7 +2355,7 @@ PyObject* PyType_FromSpec(PyType_Spec *spec)
|
|||
res->ht_type.tp_flags = spec->flags | Py_TPFLAGS_HEAPTYPE;
|
||||
|
||||
for (slot = spec->slots; slot->slot; slot++) {
|
||||
if (slot->slot >= sizeof(slotoffsets)/sizeof(slotoffsets[0])) {
|
||||
if (slot->slot >= Py_ARRAY_LENGTH(slotoffsets)) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "invalid slot offset");
|
||||
goto fail;
|
||||
}
|
||||
|
@ -2583,7 +2583,7 @@ type_prepare(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
return PyDict_New();
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
Merge the __dict__ of aclass into dict, and recursively also all
|
||||
the __dict__s of aclass's base classes. The order of merging isn't
|
||||
defined, as it's expected that only the final set of dict keys is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue