summaryrefslogtreecommitdiffstats
path: root/src/script/scons-time.py
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2015-12-24 16:32:14 (GMT)
committerRussel Winder <russel@winder.org.uk>2015-12-24 16:32:14 (GMT)
commit2a270c8f314e959c78e9deda29c8f250bb934dd6 (patch)
tree7008e644357036404f0861c8ba1bbbf43b2b4123 /src/script/scons-time.py
parenta7d764ed831fa3243aa0bd3307f641e1e1f9f8a8 (diff)
parent9d558dd65deacc958edc1f0da2dab1ec56ff4e4e (diff)
downloadSCons-2a270c8f314e959c78e9deda29c8f250bb934dd6.zip
SCons-2a270c8f314e959c78e9deda29c8f250bb934dd6.tar.gz
SCons-2a270c8f314e959c78e9deda29c8f250bb934dd6.tar.bz2
Post merge commit for safety. Building Fortran code works, but tests fail.
Diffstat (limited to 'src/script/scons-time.py')
-rw-r--r--src/script/scons-time.py45
1 files changed, 1 insertions, 44 deletions
diff --git a/src/script/scons-time.py b/src/script/scons-time.py
index 9737dfe..ebdaf08 100644
--- a/src/script/scons-time.py
+++ b/src/script/scons-time.py
@@ -42,53 +42,10 @@ import sys
import tempfile
import time
-try:
- sorted
-except NameError:
- # Pre-2.4 Python has no sorted() function.
- #
- # The pre-2.4 Python list.sort() method does not support
- # list.sort(key=) nor list.sort(reverse=) keyword arguments, so
- # we must implement the functionality of those keyword arguments
- # by hand instead of passing them to list.sort().
- def sorted(iterable, cmp=None, key=None, reverse=False):
- if key is not None:
- result = [(key(x), x) for x in iterable]
- else:
- result = iterable[:]
- if cmp is None:
- # Pre-2.3 Python does not support list.sort(None).
- result.sort()
- else:
- result.sort(cmp)
- if key is not None:
- result = [t1 for t0,t1 in result]
- if reverse:
- result.reverse()
- return result
-
-if os.environ.get('SCONS_HORRIBLE_REGRESSION_TEST_HACK') is not None:
- # We can't apply the 'callable' fixer until the floor is 2.6, but the
- # '-3' option to Python 2.6 and 2.7 generates almost ten thousand
- # warnings. This hack allows us to run regression tests with the '-3'
- # option by replacing the callable() built-in function with a hack
- # that performs the same function but doesn't generate the warning.
- # Note that this hack is ONLY intended to be used for regression
- # testing, and should NEVER be used for real runs.
- from types import ClassType
- def callable(obj):
- if hasattr(obj, '__call__'): return True
- if isinstance(obj, (ClassType, type)): return True
- return False
-
def make_temp_file(**kw):
try:
result = tempfile.mktemp(**kw)
- try:
- result = os.path.realpath(result)
- except AttributeError:
- # Python 2.1 has no os.path.realpath() method.
- pass
+ result = os.path.realpath(result)
except TypeError:
try:
save_template = tempfile.template