From 8b1271b12fdbb1ac01217d929d8b112119e3f53b Mon Sep 17 00:00:00 2001 From: Eddie Elizondo Date: Mon, 6 May 2019 11:28:50 -0400 Subject: Only count number of members once (#12691) --- Objects/typeobject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 37df4d2..eeaae1f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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++; } -- cgit v0.12