Only count number of members once (#12691)
This commit is contained in:
parent
e152169da9
commit
8b1271b12f
|
@ -2895,6 +2895,7 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
|
|||
nmembers = 0;
|
||||
for (slot = spec->slots; slot->slot; slot++) {
|
||||
if (slot->slot == Py_tp_members) {
|
||||
nmembers = 0;
|
||||
for (memb = slot->pfunc; memb->name != NULL; memb++) {
|
||||
nmembers++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue