summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Script/Main.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Script/Main.py')
-rw-r--r--src/engine/SCons/Script/Main.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 076c30b..0d626cb 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -17,7 +17,7 @@ unsupported_python_version = (2, 6, 0)
deprecated_python_version = (2, 7, 0)
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -38,7 +38,7 @@ deprecated_python_version = (2, 7, 0)
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Script/Main.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Main.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
import SCons.compat
@@ -48,6 +48,7 @@ import sys
import time
import traceback
import sysconfig
+import platform
import SCons.CacheDir
import SCons.Debug
@@ -58,6 +59,7 @@ import SCons.Job
import SCons.Node
import SCons.Node.FS
import SCons.Platform
+import SCons.Platform.virtualenv
import SCons.SConf
import SCons.Script
import SCons.Taskmaster
@@ -622,7 +624,7 @@ def _SConstruct_exists(dirname='', repositories=[], filelist=None):
current directory.
"""
if not filelist:
- filelist = ['SConstruct', 'Sconstruct', 'sconstruct']
+ filelist = ['SConstruct', 'Sconstruct', 'sconstruct', 'SConstruct.py', 'Sconstruct.py', 'sconstruct.py']
for file in filelist:
sfile = os.path.join(dirname, file)
if os.path.isfile(sfile):
@@ -862,6 +864,13 @@ def _main(parser):
for warning_type, message in delayed_warnings:
SCons.Warnings.warn(warning_type, message)
+ if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:
+ if options.enable_virtualenv:
+ SCons.Platform.virtualenv.enable_virtualenv = True
+
+ if options.ignore_virtualenv:
+ SCons.Platform.virtualenv.ignore_virtualenv = True
+
if options.diskcheck:
SCons.Node.FS.set_diskcheck(options.diskcheck)
@@ -1253,7 +1262,11 @@ def _build_targets(fs, options, targets, target_top):
BuildTask.options = options
- python_has_threads = sysconfig.get_config_var('WITH_THREAD')
+ is_pypy = platform.python_implementation() == '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 >= (3, 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
@@ -1347,7 +1360,7 @@ def main():
pass
parts.append(version_string("engine", SCons))
parts.append(path_string("engine", SCons))
- parts.append("Copyright (c) 2001 - 2017 The SCons Foundation")
+ parts.append("Copyright (c) 2001 - 2019 The SCons Foundation")
version = ''.join(parts)
from . import SConsOptions
@@ -1363,7 +1376,7 @@ def main():
revert_io()
except SystemExit as s:
if s:
- exit_status = s
+ exit_status = s.code
except KeyboardInterrupt:
print("scons: Build interrupted.")
sys.exit(2)