]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-135639: fix `test_cycle` test (#135662)
authorKumar Aditya <kumaraditya@python.org>
Wed, 18 Jun 2025 16:41:35 +0000 (22:11 +0530)
committerGitHub <noreply@github.com>
Wed, 18 Jun 2025 16:41:35 +0000 (22:11 +0530)
Lib/test/test_free_threading/test_itertools.py

index 8360afbf78cadda8bdc537f92acfa909e7d217be..b8663ade1d4aca9c43f310aecddbf348f967e51e 100644 (file)
@@ -44,7 +44,10 @@ class ItertoolsThreading(unittest.TestCase):
         def work(it):
             barrier.wait()
             for _ in range(number_of_cycles):
-                _ = next(it)
+                try:
+                    next(it)
+                except StopIteration:
+                    pass
 
         data = (1, 2, 3, 4)
         for it in range(number_of_iterations):