Skip to content

Commit 3b3721f

Browse files
committed
gh-132969: Remove import of multiprocessing and use self.get_context() as the mp_context
1 parent ec2543a commit 3b3721f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Lib/test/test_concurrent_futures/test_shutdown.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,6 @@ def _run_test_issue_gh_132969(self, max_workers: int) -> int:
344344
# max_workers=2 will repro exception
345345
# max_workers=4 will repro exception and then hang
346346

347-
import multiprocessing as mp
348-
349347
# Repro conditions
350348
# max_tasks_per_child=1
351349
# a task ends abnormally
@@ -358,7 +356,7 @@ def _run_test_issue_gh_132969(self, max_workers: int) -> int:
358356
executor = futures.ProcessPoolExecutor(
359357
max_workers=max_workers,
360358
max_tasks_per_child=1,
361-
mp_context=mp.get_context("spawn"))
359+
mp_context=self.get_context())
362360
f1 = executor.submit(ProcessPoolShutdownTest._good_task_gh_132969, 1)
363361
f2 = executor.submit(ProcessPoolShutdownTest._failing_task_gh_132969, 2)
364362
f3 = executor.submit(ProcessPoolShutdownTest._good_task_gh_132969, 3)

0 commit comments

Comments
 (0)