From e2e35d3c7c8f435406b5a59679d39ea5433193b1 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sun, 13 Sep 2009 23:33:03 +0000 Subject: [PATCH] Have TestSCons.py add --warn=no-python-version every invocation, not just at TestSCons intialization. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4360 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- QMTest/TestSCons.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index 89fe5a64..b4e910a4 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): -- 2.26.2