From a29fca804cc209bc70c9aaddb0f51d5e81a5cac0 Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Thu, 12 Jul 2018 08:03:48 -0400 Subject: Fix -jN for Python3.7, which always has thread support --- src/CHANGES.txt | 1 + src/engine/SCons/Script/Main.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 01418bc..4a050b0 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -78,6 +78,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE From Gary Oberbrunner: - Fix bug when Installing multiple subdirs outside the source tree - fix to_str to handle None without raising exception + - Fix -jN for python 3.7 From Jonathon Reinhart: - Replace all instances of `int main()` in C code with `int main(void)`. diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 923ef1e..1d3fb54 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -1255,7 +1255,11 @@ def _build_targets(fs, options, targets, target_top): is_pypy = platform.python_implementation() == 'PyPy' - python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy + # As of 3.7, python removed support for threadless platforms. + # See https://www.python.org/dev/peps/pep-0011/ + is_37_or_later = sys.version_info.major > 3 or \ + sys.version_info.major == 3 and sys.version_info.minor >= 7 + python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy or is_37_or_later # to check if python configured with threads. global num_jobs num_jobs = options.num_jobs -- cgit v0.12