summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bench/bench.py4
-rw-r--r--src/engine/SCons/Environment.py4
-rw-r--r--src/engine/SCons/Node/FSTests.py5
-rw-r--r--src/engine/SCons/Node/NodeTests.py5
-rw-r--r--src/engine/SCons/Platform/__init__.py5
-rw-r--r--test/option/debug-time.py4
6 files changed, 21 insertions, 6 deletions
diff --git a/bench/bench.py b/bench/bench.py
index 2acc29f8..a839ed65 100644
--- a/bench/bench.py
+++ b/bench/bench.py
@@ -110,7 +110,9 @@ def timer(func, *args, **kw):
return results
def display(label, results):
- total = reduce(lambda x, y: x+y, results, 0.0)
+ total = 0.0
+ for r in results:
+ total += r
print " %8.3f" % ((total * 1e6) / len(results)), ':', label
for func in FunctionList:
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index cd637bb2..d9db8528 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -1507,7 +1507,9 @@ class Base(SubstitutionEnvironment):
else:
tdlist.append((target.split(), depends.split()))
if only_one:
- targets = reduce(lambda x, y: x+y, [p[0] for p in tdlist])
+ targets = []
+ for td in tdlist:
+ targets.extend(td[0])
if len(targets) > 1:
raise SCons.Errors.UserError(
"More than one dependency target found in `%s': %s"
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 339d1245..58726d3b 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -2093,7 +2093,10 @@ class EntryTestCase(_tempdirTestCase):
def __init__(self, val):
self.val = val
def collect(self, args):
- return reduce(lambda x, y: x+y, args)
+ result = 0
+ for a in args:
+ result += a
+ return result
def signature(self, executor):
return self.val + 222
self.module = M(val)
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index 6de6d386..beb9a31c 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -215,7 +215,10 @@ class Calculator:
def signature(self, args):
return self.val
def collect(self, args):
- return reduce(lambda x, y: x+y, args, self.val)
+ result = self.val
+ for a in args:
+ result += a
+ return result
self.module = M(val)
diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py
index 244d0900..e1066f02 100644
--- a/src/engine/SCons/Platform/__init__.py
+++ b/src/engine/SCons/Platform/__init__.py
@@ -166,7 +166,10 @@ class TempFileMunge:
except ValueError:
maxline = 2048
- if (reduce(lambda x, y: x + len(y), cmd, 0) + len(cmd)) <= maxline:
+ length = 0
+ for c in cmd:
+ length += len(c)
+ if length <= maxline:
return self.cmd
# We do a normpath because mktemp() has what appears to be
diff --git a/test/option/debug-time.py b/test/option/debug-time.py
index a1e0254f..39a47c1f 100644
--- a/test/option/debug-time.py
+++ b/test/option/debug-time.py
@@ -110,7 +110,9 @@ expected_total_time = complete_time - overhead
pattern = r'Command execution time: (\d+\.\d+) seconds'
times = list(map(float, re.findall(pattern, test.stdout())))
-expected_command_time = reduce(lambda x, y: x + y, times, 0.0)
+expected_command_time = 0.0
+for t in times:
+ expected_command_time += t
stdout = test.stdout()