diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-04-24 05:51:13 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-04-24 05:51:13 (GMT) |
commit | 7e116b31182749950856c622ca7932031f8be19c (patch) | |
tree | a4b9f900e52561a91e0c4509dc6c692492996b7f /QMTest | |
parent | 591b78f0f314f11192fdf13d3baa66f81b160e44 (diff) | |
download | SCons-7e116b31182749950856c622ca7932031f8be19c.zip SCons-7e116b31182749950856c622ca7932031f8be19c.tar.gz SCons-7e116b31182749950856c622ca7932031f8be19c.tar.bz2 |
http://scons.tigris.org/issues/show_bug.cgi?id=2345
Comb out all code that supported earlier versions of Python. Most such
code is in snippets of only a few lines and can be identified by having
a Python version string in it. Such snippets add up; this combing pass
probably got rid of over 500 lines of code.
Diffstat (limited to 'QMTest')
-rw-r--r-- | QMTest/TestCmd.py | 19 | ||||
-rw-r--r-- | QMTest/TestCommon.py | 1 | ||||
-rw-r--r-- | QMTest/TestSCons.py | 35 | ||||
-rw-r--r-- | QMTest/scons_tdb.py | 1 | ||||
-rw-r--r-- | QMTest/unittest.py | 1 |
5 files changed, 3 insertions, 54 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index 0d07be6..301e5a6 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -213,7 +213,6 @@ version. # PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, # AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __author__ = "Steven Knight <knight at baldmt dot com>" __revision__ = "TestCmd.py 0.37.D001 2010/01/11 16:55:50 knight" @@ -293,8 +292,6 @@ re_space = re.compile('\s') _Cleanup = [] -_chain_to_exitfunc = None - def _clean(): global _Cleanup cleanlist = [_f for _f in _Cleanup if _f] @@ -302,20 +299,8 @@ def _clean(): cleanlist.reverse() for test in cleanlist: test.cleanup() - if _chain_to_exitfunc: - _chain_to_exitfunc() - -try: - import atexit -except ImportError: - # TODO(1.5): atexit requires python 2.0, so chain sys.exitfunc - try: - _chain_to_exitfunc = sys.exitfunc - except AttributeError: - pass - sys.exitfunc = _clean -else: - atexit.register(_clean) +import atexit +atexit.register(_clean) def _caller(tblist, skip): string = "" diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py index 0bc2429..fce0fc8 100644 --- a/QMTest/TestCommon.py +++ b/QMTest/TestCommon.py @@ -88,7 +88,6 @@ The TestCommon module also provides the following variables # PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, # AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __author__ = "Steven Knight <knight at baldmt dot com>" __revision__ = "TestCommon.py 0.37.D001 2010/01/11 16:55:50 knight" diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index a8bfd46..e35cbfe 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -13,7 +13,6 @@ attributes defined in this subclass. """ # __COPYRIGHT__ -from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -407,8 +406,6 @@ class TestSCons(TestCommon): kw['arguments'] = option + arguments else: kw['arguments'] = option + ' ' + arguments - # TODO(1.5) - #return self.run(**kw) return self.run(**kw) def diff_substr(self, expect, actual, prelen=20, postlen=40): @@ -1045,8 +1042,6 @@ class TimeSCons(TestSCons): if 'verbose' not in kw and not self.calibrate: kw['verbose'] = True - # TODO(1.5) - #TestSCons.__init__(self, *args, **kw) TestSCons.__init__(self, *args, **kw) # TODO(sgk): better way to get the script dir than sys.argv[0] @@ -1080,15 +1075,9 @@ class TimeSCons(TestSCons): options.append('%s=%s' % (variable, value)) kw['options'] = ' '.join(options) if self.calibrate: - # TODO(1.5) - #self.calibration(*args, **kw) self.calibration(*args, **kw) else: self.uptime() - # TODO(1.5) - #self.startup(*args, **kw) - #self.full(*args, **kw) - #self.null(*args, **kw) self.startup(*args, **kw) self.full(*args, **kw) self.null(*args, **kw) @@ -1109,8 +1098,6 @@ class TimeSCons(TestSCons): "seconds", sort=0) for name, args in stats.items(): - # TODO(1.5) - #self.trace(name, trace, *args) self.trace(name, trace, **args) def uptime(self): @@ -1150,8 +1137,6 @@ class TimeSCons(TestSCons): # won't report any statistics for it, but we can still execute # the full and null builds. kw['status'] = None - # TODO(1.5) - #self.run(*args, **kw) self.run(*args, **kw) sys.stdout.write(self.stdout()) stats = self.collect_stats(self.stdout()) @@ -1164,16 +1149,10 @@ class TimeSCons(TestSCons): """ Runs a full build of SCons. """ - # TODO(1.5) - #self.run(*args, **kw) self.run(*args, **kw) sys.stdout.write(self.stdout()) stats = self.collect_stats(self.stdout()) self.report_traces('full', stats) - # TODO(1.5) - #self.trace('full-memory', 'initial', **stats['memory-initial']) - #self.trace('full-memory', 'prebuild', **stats['memory-prebuild']) - #self.trace('full-memory', 'final', **stats['memory-final']) self.trace('full-memory', 'initial', **stats['memory-initial']) self.trace('full-memory', 'prebuild', **stats['memory-prebuild']) self.trace('full-memory', 'final', **stats['memory-final']) @@ -1184,8 +1163,6 @@ class TimeSCons(TestSCons): information (the variable(s) that were set for this configuration, and the elapsed time to run. """ - # TODO(1.5) - #self.run(*args, **kw) self.run(*args, **kw) if self.variables: for variable, value in self.variables.items(): @@ -1198,11 +1175,7 @@ class TimeSCons(TestSCons): """ # TODO(sgk): allow the caller to specify the target (argument) # that must be up-to-date. - # TODO(1.5) - #self.up_to_date(arguments='.', **kw) - kw = kw.copy() - kw['arguments'] = '.' - self.up_to_date(**kw) + self.up_to_date(arguments='.', **kw) sys.stdout.write(self.stdout()) stats = self.collect_stats(self.stdout()) # time-commands should always be 0.0 on a null build, because @@ -1213,10 +1186,6 @@ class TimeSCons(TestSCons): if float(stats['time-commands']['value']) == 0.0: del stats['time-commands'] self.report_traces('null', stats) - # TODO(1.5) - #self.trace('null-memory', 'initial', **stats['memory-initial']) - #self.trace('null-memory', 'prebuild', **stats['memory-prebuild']) - #self.trace('null-memory', 'final', **stats['memory-final']) self.trace('null-memory', 'initial', **stats['memory-initial']) self.trace('null-memory', 'prebuild', **stats['memory-prebuild']) self.trace('null-memory', 'final', **stats['memory-final']) @@ -1239,8 +1208,6 @@ class TimeSCons(TestSCons): kw['options'] = kw.get('options', '') + ' --debug=memory --debug=time' self.startTime = time.time() try: - # TODO(1.5) - #result = TestSCons.run(self, *args, **kw) result = TestSCons.run(self, *args, **kw) finally: self.endTime = time.time() diff --git a/QMTest/scons_tdb.py b/QMTest/scons_tdb.py index e56af3d..e2c40df 100644 --- a/QMTest/scons_tdb.py +++ b/QMTest/scons_tdb.py @@ -27,7 +27,6 @@ QMTest classes to support SCons' testing and Aegis-inspired workflow. Thanks to Stefan Seefeld for the initial code. """ -from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" diff --git a/QMTest/unittest.py b/QMTest/unittest.py index 4a4433e..da2bf00 100644 --- a/QMTest/unittest.py +++ b/QMTest/unittest.py @@ -28,7 +28,6 @@ PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. """ -from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __author__ = "Steve Purcell (stephen_purcell@yahoo.com)" __version__ = "$ Revision: 1.23 $"[11:-2] |