File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1043,17 +1043,21 @@ def checker():
10431043 def test_settrace_all_threads_race (self ):
10441044 # GH-132296: settrace_all_threads() could be racy on the free-threaded build
10451045 #if the threads were concurrently deleted.
1046+ old_trace = threading .gettrace ()
10461047 def dummy (* args ):
10471048 pass
10481049
10491050 def do_settrace ():
10501051 threading .settrace_all_threads (dummy )
10511052
1052- with threading_helper .catch_threading_exception () as cm :
1053- with threading_helper .start_threads ((threading .Thread (target = do_settrace ) for _ in range (8 ))):
1054- pass
1053+ try :
1054+ with threading_helper .catch_threading_exception () as cm :
1055+ with threading_helper .start_threads ((threading .Thread (target = do_settrace ) for _ in range (8 ))):
1056+ pass
10551057
1056- self .assertIsNone (cm .exc_value )
1058+ self .assertIsNone (cm .exc_value )
1059+ finally :
1060+ threading .settrace_all_threads (old_trace )
10571061
10581062 def test_getprofile (self ):
10591063 def fn (* args ): pass
You can’t perform that action at this time.
0 commit comments