@@ -4438,9 +4438,8 @@ def _extract_logrecord_process_name(key, logMultiprocessing, conn=None):
4438
4438
4439
4439
r1 = logging .makeLogRecord ({'msg' : f'msg1_{ key } ' })
4440
4440
4441
+ # https://bugs.python.org/issue45128
4441
4442
with support .swap_item (sys .modules , 'multiprocessing' , None ):
4442
- # We need to restore the previous `multiprocessing` module:
4443
- # https://bugs.python.org/issue45128
4444
4443
r2 = logging .makeLogRecord ({'msg' : f'msg2_{ key } ' })
4445
4444
4446
4445
results = {'processName' : name ,
@@ -4454,7 +4453,7 @@ def _extract_logrecord_process_name(key, logMultiprocessing, conn=None):
4454
4453
else :
4455
4454
return results
4456
4455
4457
- def test_multiprocessing (self , first_pass = True ):
4456
+ def test_multiprocessing (self ):
4458
4457
multiprocessing_imported = 'multiprocessing' in sys .modules
4459
4458
try :
4460
4459
# logMultiprocessing is True by default
@@ -4490,16 +4489,6 @@ def test_multiprocessing(self, first_pass=True):
4490
4489
if multiprocessing_imported :
4491
4490
import multiprocessing
4492
4491
4493
- if first_pass : # https://bugs.python.org/issue45128
4494
- import multiprocessing .queues
4495
-
4496
- self .test_multiprocessing (first_pass = False )
4497
-
4498
- import multiprocessing
4499
- import multiprocessing .connection
4500
- from multiprocessing .connection import wait
4501
- multiprocessing .connection # It was AttributeError here
4502
-
4503
4492
def test_optional (self ):
4504
4493
r = logging .makeLogRecord ({})
4505
4494
NOT_NONE = self .assertIsNotNone
0 commit comments