diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2015-04-22 06:39:19 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2015-04-22 06:39:19 (GMT) |
commit | d86ef05a02e820adfd1e3a11cd56d3444d9aa2c9 (patch) | |
tree | 30787c75b3ea3d03e90022ca6a42f539403e1250 /Lib/compileall.py | |
parent | c3a7f181008fef91b5a5977b370271ce3f7f75b0 (diff) | |
download | cpython-d86ef05a02e820adfd1e3a11cd56d3444d9aa2c9.zip cpython-d86ef05a02e820adfd1e3a11cd56d3444d9aa2c9.tar.gz cpython-d86ef05a02e820adfd1e3a11cd56d3444d9aa2c9.tar.bz2 |
Issue #23917: Fall back to sequential compilation when ProcessPoolExecutor doesn't exist.
Patch by Claudiu Popa.
Diffstat (limited to 'Lib/compileall.py')
-rw-r--r-- | Lib/compileall.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py index aeaaf8e..64c0a9a 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -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: |