gh-120608: Make reversed iterator work with free-threading (#120971)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Pieter Eendebak 2025-03-12 12:39:52 +01:00 committed by GitHub
parent 4dcbe06fd2
commit 1fb7e2aeb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 65 additions and 10 deletions

View file

@ -2605,7 +2605,8 @@ class StrTest(string_tests.StringLikeTest,
def test_free_after_iterating(self):
support.check_free_after_iterating(self, iter, str)
support.check_free_after_iterating(self, reversed, str)
if not support.Py_GIL_DISABLED:
support.check_free_after_iterating(self, reversed, str)
def test_check_encoding_errors(self):
# bpo-37388: str(bytes) and str.decode() must check encoding and errors