File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Lib/test/test_multiprocessing_forkserver Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 33import multiprocessing
44import multiprocessing .forkserver
55import unittest
6- import warnings
76
87
98class TestForkserverPreload (unittest .TestCase ):
@@ -86,7 +85,9 @@ def test_preload_on_error_fail_breaks_context(self):
8685 with self .assertRaises ((EOFError , ConnectionError , BrokenPipeError )) as cm :
8786 p .start () # Exception raised here
8887 # Verify that the helpful note was added
89- self .assertIn ('Forkserver process may have crashed' , str (cm .exception .__notes__ [0 ]))
88+ notes = getattr (cm .exception , '__notes__' , [])
89+ self .assertTrue (notes , "Expected exception to have __notes__" )
90+ self .assertIn ('Forkserver process may have crashed' , notes [0 ])
9091 finally :
9192 # Ensure pipes are closed even if exception is raised
9293 w .close ()
You can’t perform that action at this time.
0 commit comments