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;
|
nmembers = 0;
|
||||||
for (slot = spec->slots; slot->slot; slot++) {
|
for (slot = spec->slots; slot->slot; slot++) {
|
||||||
if (slot->slot == Py_tp_members) {
|
if (slot->slot == Py_tp_members) {
|
||||||
|
nmembers = 0;
|
||||||
for (memb = slot->pfunc; memb->name != NULL; memb++) {
|
for (memb = slot->pfunc; memb->name != NULL; memb++) {
|
||||||
nmembers++;
|
nmembers++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user