Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5bb9a8f

Browse files
committed
Remove a couple of local imports.
1 parent 6c64cc1 commit 5bb9a8f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Lib/test/test_multiprocessing.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,15 +2494,14 @@ def _child_test_wait(cls, w, slow):
24942494
w.close()
24952495

24962496
def test_wait(self, slow=False):
2497-
from multiprocessing import Pipe, Process
24982497
from multiprocessing.connection import wait
24992498
readers = []
25002499
procs = []
25012500
messages = []
25022501

25032502
for i in range(4):
2504-
r, w = Pipe(duplex=False)
2505-
p = Process(target=self._child_test_wait, args=(w, slow))
2503+
r, w = multiprocessing.Pipe(duplex=False)
2504+
p = multiprocessing.Process(target=self._child_test_wait, args=(w, slow))
25062505
p.daemon = True
25072506
p.start()
25082507
w.close()
@@ -2535,7 +2534,6 @@ def _child_test_wait_socket(cls, address, slow):
25352534
s.close()
25362535

25372536
def test_wait_socket(self, slow=False):
2538-
from multiprocessing import Process
25392537
from multiprocessing.connection import wait
25402538
l = socket.socket()
25412539
l.bind(('', 0))
@@ -2546,7 +2544,8 @@ def test_wait_socket(self, slow=False):
25462544
dic = {}
25472545

25482546
for i in range(4):
2549-
p = Process(target=self._child_test_wait_socket, args=(addr, slow))
2547+
p = multiprocessing.Process(target=self._child_test_wait_socket,
2548+
args=(addr, slow))
25502549
p.daemon = True
25512550
p.start()
25522551
procs.append(p)

0 commit comments

Comments
 (0)