Skip to content

Commit 01f31a7

Browse files
use ctx manager
1 parent b36bd50 commit 01f31a7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/test/test_free_threading/test_reversed.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class TestReversed(unittest.TestCase):
88

99
@threading_helper.reap_threads
1010
def test_reversed(self):
11-
# Iterating over the iterator with multiple threads should not
11+
# Iterating over the iterator with multiple threads should not
1212
# emit TSAN warnings
1313
number_of_iterations = 10
1414
number_of_threads = 10
@@ -29,9 +29,10 @@ def work(r):
2929
for _ in range(number_of_iterations):
3030
r = reversed(x)
3131
worker_threads = []
32-
for ii in range(number_of_threads):
32+
for _ in range(number_of_threads):
3333
worker_threads.append(Thread(target=work, args=[r]))
34-
threading_helper.start_threads(worker_threads)
34+
with threading_helper.start_threads(worker_threads):
35+
pass
3536
barrier.reset()
3637

3738
if __name__ == "__main__":

0 commit comments

Comments
 (0)