mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
Only count number of members once (#12691)
This commit is contained in:
parent
e152169da9
commit
8b1271b12f
1 changed files with 1 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue