From cce4024322a5433d441a0d9058c9a1950590ae0c Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 6 Apr 2017 16:16:05 -0700 Subject: py2/3 use sysconfig.get_config_var('WITH_THREAD') to determine if python has threads --- src/engine/SCons/Script/Main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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': -- cgit v0.12