summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Script
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-23 16:54:06 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-23 16:54:06 +0200
commitefdf3fdbcd2f7654cb8d1209a8b040914437bacd (patch)
tree19f68a3e29675ad73f57f7c639a044290660782f /src/engine/SCons/Script
parent697e33ed224b539a42ff68121f7497f5bbf941b2 (diff)
New upstream version 3.1.0upstream/3.1.0
Diffstat (limited to 'src/engine/SCons/Script')
-rw-r--r--src/engine/SCons/Script/Interactive.py2
-rw-r--r--src/engine/SCons/Script/Main.py36
-rw-r--r--src/engine/SCons/Script/MainTests.py2
-rw-r--r--src/engine/SCons/Script/SConsOptions.py53
-rw-r--r--src/engine/SCons/Script/SConscript.py2
-rw-r--r--src/engine/SCons/Script/SConscriptTests.py2
-rw-r--r--src/engine/SCons/Script/__init__.py2
7 files changed, 34 insertions, 65 deletions
diff --git a/src/engine/SCons/Script/Interactive.py b/src/engine/SCons/Script/Interactive.py
index 35e32c2..3d70728 100644
--- a/src/engine/SCons/Script/Interactive.py
+++ b/src/engine/SCons/Script/Interactive.py
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from __future__ import print_function
-__revision__ = "src/engine/SCons/Script/Interactive.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Interactive.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
__doc__ = """
SCons interactive mode
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 0d626cb..878f824 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -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 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Main.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import SCons.compat
@@ -68,6 +68,20 @@ import SCons.Warnings
import SCons.Script.Interactive
+# Global variables
+first_command_start = None
+last_command_end = None
+print_objects = 0
+print_memoizer = 0
+print_stacktrace = 0
+print_time = 0
+sconscript_time = 0
+cumulative_command_time = 0
+exit_status = 0 # final exit status, assume success by default
+this_build_status = 0 # "exit status" of an individual build
+num_jobs = None
+delayed_warnings = []
+
def fetch_win32_parallel_msg():
# A subsidiary function that exists solely to isolate this import
@@ -87,15 +101,14 @@ def revert_io():
sys.stderr = sys.__stderr__
sys.stdout = sys.__stdout__
+
class SConsPrintHelpException(Exception):
pass
+
display = SCons.Util.display
progress_display = SCons.Util.DisplayEngine()
-first_command_start = None
-last_command_end = None
-
class Progressor(object):
prev = ''
@@ -443,19 +456,6 @@ def python_version_deprecated(version=sys.version_info):
return version < deprecated_python_version
-# Global variables
-
-print_objects = 0
-print_memoizer = 0
-print_stacktrace = 0
-print_time = 0
-sconscript_time = 0
-cumulative_command_time = 0
-exit_status = 0 # final exit status, assume success by default
-this_build_status = 0 # "exit status" of an individual build
-num_jobs = None
-delayed_warnings = []
-
class FakeOptionParser(object):
"""
A do-nothing option parser, used for the initial OptionsParser variable.
@@ -1170,7 +1170,7 @@ def _build_targets(fs, options, targets, target_top):
# -U, local SConscript Default() targets
target_top = fs.Dir(target_top)
def check_dir(x, target_top=target_top):
- if hasattr(x, 'cwd') and not x.cwd is None:
+ if hasattr(x, 'cwd') and x.cwd is not None:
cwd = x.cwd.srcnode()
return cwd == target_top
else:
diff --git a/src/engine/SCons/Script/MainTests.py b/src/engine/SCons/Script/MainTests.py
index 64d3e0f..752ea0a 100644
--- a/src/engine/SCons/Script/MainTests.py
+++ b/src/engine/SCons/Script/MainTests.py
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/MainTests.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
+__revision__ = "src/engine/SCons/Script/MainTests.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import unittest
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index 8f31fd8..5651c96 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/SConsOptions.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConsOptions.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import optparse
import re
@@ -147,7 +147,7 @@ class SConsValues(optparse.Values):
"""
Sets an option from an SConscript file.
"""
- if not name in self.settable:
+ if name not in self.settable:
raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name)
if name == 'num_jobs':
@@ -167,7 +167,7 @@ class SConsValues(optparse.Values):
value = str(value)
except ValueError:
raise SCons.Errors.UserError("A string is required: %s"%repr(value))
- if not value in SCons.Node.FS.Valid_Duplicates:
+ if value not in SCons.Node.FS.Valid_Duplicates:
raise SCons.Errors.UserError("Not a valid duplication style: %s" % value)
# Set the duplicate style right away so it can affect linking
# of SConscript files.
@@ -226,39 +226,8 @@ class SConsOption(optparse.Option):
fmt = "option %s: nargs='?' is incompatible with short options"
raise SCons.Errors.UserError(fmt % self._short_opts[0])
- try:
- _orig_CONST_ACTIONS = optparse.Option.CONST_ACTIONS
-
- _orig_CHECK_METHODS = optparse.Option.CHECK_METHODS
-
- except AttributeError:
- # optparse.Option had no CONST_ACTIONS before Python 2.5.
-
- _orig_CONST_ACTIONS = ("store_const",)
-
- def _check_const(self):
- if self.action not in self.CONST_ACTIONS and self.const is not None:
- raise OptionError(
- "'const' must not be supplied for action %r" % self.action,
- self)
-
- # optparse.Option collects its list of unbound check functions
- # up front. This sucks because it means we can't just override
- # the _check_const() function like a normal method, we have to
- # actually replace it in the list. This seems to be the most
- # straightforward way to do that.
-
- _orig_CHECK_METHODS = [optparse.Option._check_action,
- optparse.Option._check_type,
- optparse.Option._check_choice,
- optparse.Option._check_dest,
- _check_const,
- optparse.Option._check_nargs,
- optparse.Option._check_callback]
-
- CHECK_METHODS = _orig_CHECK_METHODS + [_check_nargs_optional]
-
- CONST_ACTIONS = _orig_CONST_ACTIONS + optparse.Option.TYPED_ACTIONS
+ CHECK_METHODS = optparse.Option.CHECK_METHODS + [_check_nargs_optional]
+ CONST_ACTIONS = optparse.Option.CONST_ACTIONS + optparse.Option.TYPED_ACTIONS
class SConsOptionGroup(optparse.OptionGroup):
"""
@@ -364,7 +333,7 @@ class SConsOptionParser(optparse.OptionParser):
in self.largs, so that any value overridden on the
command line is immediately available if the user turns
around and does a GetOption() right away.
-
+
We mimic the processing of the single args
in the original OptionParser._process_args(), but here we
allow exact matches for long-opts only (no partial
@@ -375,7 +344,7 @@ class SConsOptionParser(optparse.OptionParser):
command-line arguments that
1. haven't been processed so far (self.largs), but
2. are possibly not added to the list of options yet.
-
+
So, when we only have a value for "--myargument" yet,
a command-line argument of "--myarg=test" would set it.
Responsible for this behaviour is the method
@@ -384,7 +353,7 @@ class SConsOptionParser(optparse.OptionParser):
be unique.
This would lead to further confusion, because we might want
to add another option "--myarg" later on (see issue #2929).
-
+
"""
rargs = []
largs_restore = []
@@ -401,7 +370,7 @@ class SConsOptionParser(optparse.OptionParser):
if "=" in l:
# Split into option and value
lopt = l.split("=", 1)
-
+
if lopt[0] in self._long_opt:
# Argument is already known
rargs.append('='.join(lopt))
@@ -416,7 +385,7 @@ class SConsOptionParser(optparse.OptionParser):
skip = True
else:
rargs.append(l)
-
+
# Parse the filtered list
self.parse_args(rargs, self.values)
# Restore the list of remaining arguments for the
@@ -690,7 +659,7 @@ def Parser(version):
metavar="TYPE")
def opt_duplicate(option, opt, value, parser):
- if not value in SCons.Node.FS.Valid_Duplicates:
+ if value not in SCons.Node.FS.Valid_Duplicates:
raise OptionValueError(opt_invalid('duplication', value,
SCons.Node.FS.Valid_Duplicates))
setattr(parser.values, option.dest, value)
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index ea239e0..9687c29 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -27,7 +27,7 @@ files.
# 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/SConscript.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConscript.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import SCons
import SCons.Action
diff --git a/src/engine/SCons/Script/SConscriptTests.py b/src/engine/SCons/Script/SConscriptTests.py
index fb06ac4..c1232e8 100644
--- a/src/engine/SCons/Script/SConscriptTests.py
+++ b/src/engine/SCons/Script/SConscriptTests.py
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/SConscriptTests.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConscriptTests.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import SCons.Script.SConscript
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index 834c70d..cf2e472 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -34,7 +34,7 @@ it goes here.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/__init__.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
+__revision__ = "src/engine/SCons/Script/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import time
start_time = time.time()