File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Lib/test/test_concurrent_futures Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -106,20 +106,14 @@ def test_traceback(self):
106106 self .assertIn ('raise RuntimeError(123) # some comment' ,
107107 f1 .getvalue ())
108108
109- @staticmethod
110- def _terminate_abruptly_with_exit_code (exit_code ):
111- os ._exit (exit_code )
112-
113109 def test_traceback_when_child_process_terminates_abruptly (self ):
114110 # gh-139462 enhancement - BrokenProcessPool exceptions
115111 # should describe which process terminated.
116112 exit_code = 99
117- future = self .executor .submit (
118- self ._terminate_abruptly_with_exit_code ,
119- exit_code
120- )
121- with self .assertRaises (BrokenProcessPool ) as bpe :
122- future .result ()
113+ with self .executor_type (max_workers = 1 ) as executor :
114+ future = executor .submit (os ._exit , exit_code )
115+ with self .assertRaises (BrokenProcessPool ) as bpe :
116+ future .result ()
123117
124118 cause = bpe .exception .__cause__
125119 self .assertIsInstance (cause , futures .process ._RemoteTraceback )
You can’t perform that action at this time.
0 commit comments