diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-04-06 23:16:05 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-04-06 23:16:05 (GMT) |
commit | cce4024322a5433d441a0d9058c9a1950590ae0c (patch) | |
tree | dd2351f01f521a3cfa5dfc85979201c0d53ffc86 /src | |
parent | 072369e0cf1c10f5b88ebd21487f169eb189cf25 (diff) | |
download | SCons-cce4024322a5433d441a0d9058c9a1950590ae0c.zip SCons-cce4024322a5433d441a0d9058c9a1950590ae0c.tar.gz SCons-cce4024322a5433d441a0d9058c9a1950590ae0c.tar.bz2 |
py2/3 use sysconfig.get_config_var('WITH_THREAD') to determine if python has threads
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Script/Main.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index f9df813..b7ce466 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -47,6 +47,7 @@ import os import sys import time import traceback +import sysconfig import SCons.CacheDir import SCons.Debug @@ -1251,12 +1252,15 @@ def _build_targets(fs, options, targets, target_top): # various print_* settings, tree_printer list, etc. BuildTask.options = options + + python_has_threads = sysconfig.get_config_var('WITH_THREAD') + # to check if python configured with threads. global num_jobs num_jobs = options.num_jobs jobs = SCons.Job.Jobs(num_jobs, taskmaster) if num_jobs > 1: msg = None - if jobs.num_jobs == 1: + if jobs.num_jobs == 1 or not python_has_threads: msg = "parallel builds are unsupported by this version of Python;\n" + \ "\tignoring -j or num_jobs option.\n" elif sys.platform == 'win32': |