@@ -2143,7 +2143,7 @@ product_next_lock_held(PyObject *op)
21432143 _PyTuple_Recycle (result );
21442144 }
21452145 /* Now, we've got the only copy so we can update it in-place */
2146- assert (npools == 0 || _PyObject_IsUniquelyReferenced (result ));
2146+ assert (npools == 0 || Py_REFCNT (result ) == 1 );
21472147
21482148 /* Update the pool indices right-to-left. Only advance to the
21492149 next pool when the previous one rolls-over */
@@ -2381,7 +2381,7 @@ combinations_next_lock_held(PyObject *op)
23812381 * CPython's empty tuple is a singleton and cached in
23822382 * PyTuple's freelist.
23832383 */
2384- assert (r == 0 || _PyObject_IsUniquelyReferenced (result ));
2384+ assert (r == 0 || Py_REFCNT (result ) == 1 );
23852385
23862386 /* Scan indices right-to-left until finding one that is not
23872387 at its maximum (i + n - r). */
@@ -2633,7 +2633,7 @@ cwr_next(PyObject *op)
26332633 }
26342634 /* Now, we've got the only copy so we can update it in-place CPython's
26352635 empty tuple is a singleton and cached in PyTuple's freelist. */
2636- assert (r == 0 || _PyObject_IsUniquelyReferenced (result ));
2636+ assert (r == 0 || Py_REFCNT (result ) == 1 );
26372637
26382638 /* Scan indices right-to-left until finding one that is not
26392639 * at its maximum (n-1). */
@@ -2893,7 +2893,7 @@ permutations_next(PyObject *op)
28932893 _PyTuple_Recycle (result );
28942894 }
28952895 /* Now, we've got the only copy so we can update it in-place */
2896- assert (r == 0 || _PyObject_IsUniquelyReferenced (result ));
2896+ assert (r == 0 || Py_REFCNT (result ) == 1 );
28972897
28982898 /* Decrement rightmost cycle, moving leftward upon zero rollover */
28992899 for (i = r - 1 ; i >=0 ; i -- ) {
0 commit comments