summaryrefslogtreecommitdiffstats
path: root/QMTest
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-04-15 19:21:08 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-04-15 19:21:08 (GMT)
commitc06950cad4c02ba6b759c1cbd65cfb52ab6868c3 (patch)
treea3e265178b5b9c6d717d657133c3085747287751 /QMTest
parentd58dff5877e75c3c7813045a075e50b23ecb1dfd (diff)
downloadSCons-c06950cad4c02ba6b759c1cbd65cfb52ab6868c3.zip
SCons-c06950cad4c02ba6b759c1cbd65cfb52ab6868c3.tar.gz
SCons-c06950cad4c02ba6b759c1cbd65cfb52ab6868c3.tar.bz2
http://scons.tigris.org/issues/show_bug.cgi?id=2345
Fixes due to running the regression tests with the '-3' option to Python2.6, which causes the run-time to look for potential compatibility problems with Python 3.x. In some cases, all we can do is quiet the warning since we still support Python versions that can't use the newer idiom. In other cases, we fix the problem. This patch contains a mix of quieting and fixing, plus a little lint.
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestCmd.py5
-rw-r--r--QMTest/TestSCons.py8
-rw-r--r--QMTest/unittest.py5
3 files changed, 8 insertions, 10 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index 6f53892..1568b0d 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -581,9 +581,8 @@ except ImportError:
# The subprocess module doesn't exist in this version of Python,
# so we're going to cobble up something that looks just enough
# like its API for our purposes below.
- import new
-
- subprocess = new.module('subprocess')
+ from types import ModuleType
+ class subprocess(ModuleType): pass
subprocess.PIPE = 'PIPE'
subprocess.STDOUT = 'STDOUT'
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index d61c008..a4e9c86 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -1259,12 +1259,8 @@ class TimeSCons(TestSCons):
for root, dirs, files in os.walk(source_dir):
if '.svn' in dirs:
dirs.remove('.svn')
- # TODO(1.5)
- #dirs = [ d for d in dirs if not d.startswith('TimeSCons-') ]
- #files = [ f for f in files if not f.startswith('TimeSCons-') ]
- not_timescons_entries = lambda s: not s.startswith('TimeSCons-')
- dirs = list(filter(not_timescons_entries, dirs))
- files = list(filter(not_timescons_entries, files))
+ dirs = [ d for d in dirs if not d.startswith('TimeSCons-') ]
+ files = [ f for f in files if not f.startswith('TimeSCons-') ]
for dirname in dirs:
source = os.path.join(root, dirname)
destination = source.replace(source_dir, dest_dir)
diff --git a/QMTest/unittest.py b/QMTest/unittest.py
index 1d87c15..4a4433e 100644
--- a/QMTest/unittest.py
+++ b/QMTest/unittest.py
@@ -344,7 +344,10 @@ def getTestCaseNames(testCaseClass, prefix, sortUsing=cmp):
testFnNames = testFnNames + \
getTestCaseNames(baseclass, prefix, sortUsing=None)
if sortUsing:
- testFnNames.sort(sortUsing)
+ # sortUsing is only either 'None' or 'cmp' so don't bother with arg
+ # which is not supported in Py3k.
+ #testFnNames.sort(sortUsing)
+ testFnNames.sort()
return testFnNames