summaryrefslogtreecommitdiff
path: root/sphinx/util/parallel.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/parallel.py')
-rw-r--r--sphinx/util/parallel.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/util/parallel.py b/sphinx/util/parallel.py
index 267f7bd4c..16a95e039 100644
--- a/sphinx/util/parallel.py
+++ b/sphinx/util/parallel.py
@@ -19,10 +19,11 @@ from sphinx.util import logging
logger = logging.getLogger(__name__)
if sys.platform != "win32":
+ ForkContext = multiprocessing.context.ForkContext
ForkProcess = multiprocessing.context.ForkProcess
else:
# For static typing, as ForkProcess doesn't exist on Windows
- ForkProcess = multiprocessing.process.BaseProcess
+ ForkContext = ForkProcess = Any
# our parallel functionality only works for the forking Process
parallel_available = multiprocessing and os.name == 'posix'
@@ -92,7 +93,7 @@ class ParallelTasks:
self._result_funcs[tid] = result_func or (lambda arg, result: None)
self._args[tid] = arg
precv, psend = multiprocessing.Pipe(False)
- context = multiprocessing.get_context('fork')
+ context: ForkContext = multiprocessing.get_context('fork')
proc = context.Process(target=self._process, args=(psend, task_func, arg))
self._procs[tid] = proc
self._precvsWaiting[tid] = precv