mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #23917: Fall back to sequential compilation when ProcessPoolExecutor doesn't exist.
Patch by Claudiu Popa.
This commit is contained in:
parent
c3a7f18100
commit
d86ef05a02
4 changed files with 10 additions and 9 deletions
|
|
@ -69,11 +69,9 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
|
|||
files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels,
|
||||
ddir=ddir)
|
||||
success = 1
|
||||
if workers is not None and workers != 1:
|
||||
if workers is not None and workers != 1 and ProcessPoolExecutor is not None:
|
||||
if workers < 0:
|
||||
raise ValueError('workers must be greater or equal to 0')
|
||||
if ProcessPoolExecutor is None:
|
||||
raise NotImplementedError('multiprocessing support not available')
|
||||
|
||||
workers = workers or None
|
||||
with ProcessPoolExecutor(max_workers=workers) as executor:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue