summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Elizondo <eelizondo@fb.com>2019-05-06 15:28:50 (GMT)
committerDino Viehland <dinoviehland@gmail.com>2019-05-06 15:28:50 (GMT)
commit8b1271b12fdbb1ac01217d929d8b112119e3f53b (patch)
treeb9030ee981f59f593acb8dd85e0d4c196c6b8c76
parente152169da95b52fa41931572bc90857253c4a5dd (diff)
downloadcpython-8b1271b12fdbb1ac01217d929d8b112119e3f53b.zip
cpython-8b1271b12fdbb1ac01217d929d8b112119e3f53b.tar.gz
cpython-8b1271b12fdbb1ac01217d929d8b112119e3f53b.tar.bz2
Only count number of members once (#12691)
-rw-r--r--Objects/typeobject.c1
1 files changed, 1 insertions, 0 deletions
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++;
}