File tree Expand file tree Collapse file tree
Lib/test/test_free_threading Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77
88class EnumerateThreading (unittest .TestCase ):
9- @staticmethod
10- def work (enum , start ):
11- while True :
12- try :
13- value = next (enum )
14- except StopIteration :
15- break
16-
179
1810 @threading_helper .reap_threads
1911 @threading_helper .requires_working_threading ()
@@ -23,12 +15,19 @@ def test_threading(self):
2315 n = 100
2416 start = sys .maxsize - 40
2517
18+ def work (enum , start ):
19+ while True :
20+ try :
21+ _ = next (enum )
22+ except StopIteration :
23+ break
24+
2625 for _ in range (number_of_iterations ):
2726 enum = enumerate (range (start , start + n ))
2827 worker_threads = []
2928 for ii in range (number_of_threads ):
3029 worker_threads .append (
31- Thread (target = self . work , args = [enum , start ]))
30+ Thread (target = work , args = [enum , start ]))
3231 for t in worker_threads :
3332 t .start ()
3433 for t in worker_threads :
You can’t perform that action at this time.
0 commit comments