summaryrefslogtreecommitdiffstats
path: root/Lib/compileall.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-11-05 01:56:58 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-11-05 01:56:58 (GMT)
commit52dfd4bd998417417a843b63722eae89dd180251 (patch)
tree75e4d9f5032d4caf11487e8aa0fa428b57d0c80b /Lib/compileall.py
parente37c1cbf66c5814f0f3f68a41c9bf73db6f34d92 (diff)
parentcee93c3b73a115e9f2982b9210be15c417a482dc (diff)
downloadcpython-52dfd4bd998417417a843b63722eae89dd180251.zip
cpython-52dfd4bd998417417a843b63722eae89dd180251.tar.gz
cpython-52dfd4bd998417417a843b63722eae89dd180251.tar.bz2
Issue #28485: Merge single-threading fix from 3.6
Diffstat (limited to 'Lib/compileall.py')
-rw-r--r--Lib/compileall.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 3e45785..1c9ceb6 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -68,13 +68,13 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
optimize: optimization level or -1 for level of the interpreter
workers: maximum number of parallel workers
"""
+ if workers is not None and workers < 0:
+ raise ValueError('workers must be greater or equal to 0')
+
files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels,
ddir=ddir)
success = True
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')
-
workers = workers or None
with ProcessPoolExecutor(max_workers=workers) as executor:
results = executor.map(partial(compile_file,