Only count number of members once (#12691)

This commit is contained in:
Eddie Elizondo 2019-05-06 11:28:50 -04:00 committed by Dino Viehland
parent e152169da9
commit 8b1271b12f
1 changed files with 1 additions and 0 deletions

View File

@ -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++;
}