Skip to content

Commit 3070c67

Browse files
committed
assertion fixes
1 parent 1f21e74 commit 3070c67

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Modules/_functoolsmodule.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,16 @@ partial_vectorcall(PyObject *self, PyObject *const *args,
491491
PyTuple_SET_ITEM(tot_kwnames, pto_nkwds + i, key);
492492
}
493493

494-
/* Copy pto_keywords with overlapping call keywords merged */
494+
/* Copy pto_keywords with overlapping call keywords merged
495+
* Note, tail is already coppied. */
495496
Py_ssize_t pos = 0, i = 0;
496497
while (PyDict_Next(n_merges ? pto_kw_merged : pto->kw, &pos, &key, &val)) {
497-
assert(i < tot_nkwds - n_merges);
498+
assert(i < pto_nkwds);
498499
PyTuple_SET_ITEM(tot_kwnames, i, Py_NewRef(key));
499500
stack[tot_nargs + i] = val;
500501
i++;
501502
}
502-
assert(i == tot_nkwds - n_merges);
503+
assert(i == pto_nkwds);
503504
Py_XDECREF(pto_kw_merged);
504505

505506
/* Resize Stack if the call has more than 6 keywords

0 commit comments

Comments
 (0)