summaryrefslogtreecommitdiff
path: root/engine/SCons/Script/Main.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-12 17:48:12 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-12 17:48:12 +0200
commit19712e5025e3cf6a33fccd0738f04e018d55025f (patch)
tree25683461da536e1e7ffee70279780b4f3586142f /engine/SCons/Script/Main.py
parentcd2ab5002aa2359575088bbc3183a9a91cc50c31 (diff)
New upstream version 3.0.5upstream/3.0.5
Diffstat (limited to 'engine/SCons/Script/Main.py')
-rw-r--r--engine/SCons/Script/Main.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/engine/SCons/Script/Main.py b/engine/SCons/Script/Main.py
index 0c23612..c677937 100644
--- a/engine/SCons/Script/Main.py
+++ b/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 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Main.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan"
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)