Skip to content

Commit 8b1271b

Browse files
eduardo-elizondoDinoV
authored andcommitted
Only count number of members once (python#12691)
1 parent e152169 commit 8b1271b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Objects/typeobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,6 +2895,7 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
28952895
nmembers = 0;
28962896
for (slot = spec->slots; slot->slot; slot++) {
28972897
if (slot->slot == Py_tp_members) {
2898+
nmembers = 0;
28982899
for (memb = slot->pfunc; memb->name != NULL; memb++) {
28992900
nmembers++;
29002901
}

0 commit comments

Comments
 (0)