@@ -3577,14 +3577,7 @@ def recv(self):
35773577class TestManagerExceptions (unittest .TestCase ):
35783578 # Issue 106558: Manager exceptions avoids creating cyclic references.
35793579 def setUp (self ):
3580- # gh-135427
3581- # In some of the tests, a forked child forks another child of itself. In that case, using
3582- # warnings_helper.ignore_warnings decorator does not actually ignore the warning from that
3583- # child of child, and a warnings_helper.ignore_warnings exception is raised.
3584- with warnings .catch_warnings ():
3585- warnings .filterwarnings ('ignore' ,
3586- message = ".*fork.*may lead to deadlocks in the child.*" ,
3587- category = DeprecationWarning )
3580+ with warnings_helper .ignore_fork_in_thread_deprecation_warnings ():
35883581 self .mgr = multiprocessing .Manager ()
35893582
35903583 def tearDown (self ):
@@ -5364,14 +5357,7 @@ def initializer(ns):
53645357@hashlib_helper .requires_hashdigest ('sha256' )
53655358class TestInitializers (unittest .TestCase ):
53665359 def setUp (self ):
5367- # gh-135427
5368- # In some of the tests, a forked child forks another child of itself. In that case, using
5369- # warnings_helper.ignore_warnings decorator does not actually ignore the warning from that
5370- # child of child, and a warnings_helper.ignore_warnings exception is raised.
5371- with warnings .catch_warnings ():
5372- warnings .filterwarnings ('ignore' ,
5373- message = ".*fork.*may lead to deadlocks in the child.*" ,
5374- category = DeprecationWarning )
5360+ with warnings_helper .ignore_fork_in_thread_deprecation_warnings ():
53755361 self .mgr = multiprocessing .Manager ()
53765362 self .ns = self .mgr .Namespace ()
53775363 self .ns .test = 0
@@ -6412,14 +6398,7 @@ def test_list(self):
64126398
64136399 def setUp (self ):
64146400 self .manager = self .manager_class ()
6415- # gh-135427
6416- # In some of the tests, a forked child forks another child of itself. In that case, using
6417- # warnings_helper.ignore_warnings decorator does not actually ignore the warning from that
6418- # child of child, and a warnings_helper.ignore_warnings exception is raised.
6419- with warnings .catch_warnings ():
6420- warnings .filterwarnings ('ignore' ,
6421- message = ".*fork.*may lead to deadlocks in the child.*" ,
6422- category = DeprecationWarning )
6401+ with warnings_helper .ignore_fork_in_thread_deprecation_warnings ():
64236402 self .manager .start ()
64246403 self .proc = None
64256404
@@ -7128,14 +7107,7 @@ def Pool(cls, *args, **kwds):
71287107
71297108 @classmethod
71307109 def setUpClass (cls ):
7131- # gh-135427
7132- # In some of the tests, a forked child forks another child of itself. In that case, using
7133- # warnings_helper.ignore_warnings decorator does not actually ignore the warning from that
7134- # child of child, and a warnings_helper.ignore_warnings exception is raised.
7135- with warnings .catch_warnings ():
7136- warnings .filterwarnings ('ignore' ,
7137- message = ".*fork.*may lead to deadlocks in the child.*" ,
7138- category = DeprecationWarning )
7110+ with warnings_helper .ignore_fork_in_thread_deprecation_warnings ():
71397111 super ().setUpClass ()
71407112 cls .manager = multiprocessing .Manager ()
71417113
0 commit comments