summaryrefslogtreecommitdiffstats
path: root/QMTest/TestSCons.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-09-13 23:33:03 (GMT)
committerSteven Knight <knight@baldmt.com>2009-09-13 23:33:03 (GMT)
commit64c7e4aca167a3662bf98a4a39c8d489a87d4451 (patch)
tree727b123de23aa6f82a08142b99c0ac6ccdd4dbd7 /QMTest/TestSCons.py
parent168694d14bca5aaa1a2748f03772b7c06d8786f9 (diff)
downloadSCons-64c7e4aca167a3662bf98a4a39c8d489a87d4451.zip
SCons-64c7e4aca167a3662bf98a4a39c8d489a87d4451.tar.gz
SCons-64c7e4aca167a3662bf98a4a39c8d489a87d4451.tar.bz2
Have TestSCons.py add --warn=no-python-version every invocation, not
just at TestSCons intialization.
Diffstat (limited to 'QMTest/TestSCons.py')
-rw-r--r--QMTest/TestSCons.py29
1 files changed, 20 insertions, 9 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index 89fe5a6..b4e910a 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -245,15 +245,6 @@ class TestSCons(TestCommon):
# TERM can cause test failures due to control chars in prompts etc.
os.environ['TERM'] = 'dumb'
- if deprecated_python_version():
- sconsflags = os.environ.get('SCONSFLAGS')
- if sconsflags:
- sconsflags = [sconsflags]
- else:
- sconsflags = []
- sconsflags = sconsflags + ['--warn=no-python-version']
- os.environ['SCONSFLAGS'] = string.join(sconsflags)
-
apply(TestCommon.__init__, [self], kw)
import SCons.Node.FS
@@ -341,6 +332,26 @@ class TestSCons(TestCommon):
build_str + \
term
+ def run(self, *args, **kw):
+ """
+ Add the --warn=no-python-version option to SCONSFLAGS every
+ command so test scripts don't have to filter out Python version
+ deprecation warnings.
+ """
+ save_sconsflags = os.environ.get('SCONSFLAGS')
+ if deprecated_python_version():
+ if save_sconsflags:
+ sconsflags = [save_sconsflags]
+ else:
+ sconsflags = []
+ sconsflags = sconsflags + ['--warn=no-python-version']
+ os.environ['SCONSFLAGS'] = string.join(sconsflags)
+ try:
+ result = apply(TestCommon.run, (self,)+args, kw)
+ finally:
+ sconsflags = save_sconsflags
+ return result
+
def up_to_date(self, options = None, arguments = None, read_str = "", **kw):
s = ""
for arg in string.split(arguments):