bpo-35961: Fix a crash in slice_richcompare() by vstinner · Pull Request #11828 · python/cpython
Fix a crash in slice_richcompare(): ensure that the 2 temporary
internal tuples used for the comparison are not tracked by the
garbage collector, since they use borrowed references.
The crash (or assertion error) occurred if a garbage collection
occurred during slice_richcompare(), especially while calling
PyObject_RichCompare(t1, t2, op).