diff options
author | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2022-09-27 15:18:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-27 15:18:20 +0100 |
commit | 89b4f14b44ff239d7c8ef681ed633090c179f0b0 (patch) | |
tree | 49aea5aa3eef5723cb6b622efa0b94e9ecd5ce0b /sphinx/util/parallel.py | |
parent | e0dbbc510af04970a22dcd1e836032cc29b87da2 (diff) | |
download | sphinx-git-89b4f14b44ff239d7c8ef681ed633090c179f0b0.tar.gz |
Fix mypy violations for v0.981 (#10875)
Diffstat (limited to 'sphinx/util/parallel.py')
-rw-r--r-- | sphinx/util/parallel.py | 5 |
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 |