Commit 1a0ef713 authored by Martin Panter's avatar Martin Panter

Issue #28485: Merge single-threading fix from 3.5 into 3.6

parents b1c6b40f e69d8344
...@@ -68,13 +68,13 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, ...@@ -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 optimize: optimization level or -1 for level of the interpreter
workers: maximum number of parallel workers 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, files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels,
ddir=ddir) ddir=ddir)
success = True success = True
if workers is not None and workers != 1 and ProcessPoolExecutor is not None: 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 workers = workers or None
with ProcessPoolExecutor(max_workers=workers) as executor: with ProcessPoolExecutor(max_workers=workers) as executor:
results = executor.map(partial(compile_file, results = executor.map(partial(compile_file,
......
...@@ -573,6 +573,10 @@ Core and Builtins ...@@ -573,6 +573,10 @@ Core and Builtins
Library Library
------- -------
- Issue #28485: Always raise ValueError for negative
compileall.compile_dir(workers=...) parameter, even when multithreading is
unavailable.
- Issue #28037: Use sqlite3_get_autocommit() instead of setting - Issue #28037: Use sqlite3_get_autocommit() instead of setting
Connection->inTransaction manually. Connection->inTransaction manually.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment