summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-04-06 23:16:05 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-04-06 23:16:05 (GMT)
commitcce4024322a5433d441a0d9058c9a1950590ae0c (patch)
treedd2351f01f521a3cfa5dfc85979201c0d53ffc86 /src
parent072369e0cf1c10f5b88ebd21487f169eb189cf25 (diff)
downloadSCons-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.py6
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':