summaryrefslogtreecommitdiffstats
path: root/QMTest/TestSConsMSVS.py
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
commit22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch)
tree0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /QMTest/TestSConsMSVS.py
parent75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff)
downloadSCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible; the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'QMTest/TestSConsMSVS.py')
-rw-r--r--QMTest/TestSConsMSVS.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/QMTest/TestSConsMSVS.py b/QMTest/TestSConsMSVS.py
index 0f6fc6f..ac10cd3 100644
--- a/QMTest/TestSConsMSVS.py
+++ b/QMTest/TestSConsMSVS.py
@@ -18,7 +18,6 @@ in this subclass.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import string
import sys
from TestSCons import *
@@ -596,7 +595,7 @@ print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
replace = 'sys.path = [ %s, join(sys' % enginepath
contents = self.read(fname)
- contents = string.replace(contents, orig, replace)
+ contents = contents.replace(orig, replace)
self.write(fname, contents)
def msvs_substitute(self, input, msvs_ver,
@@ -620,18 +619,18 @@ print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
if project_guid is None:
project_guid = "{E5466E26-0003-F18B-8F8A-BCD76C86388D}"
- if os.environ.has_key('SCONS_LIB_DIR'):
+ if 'SCONS_LIB_DIR' in os.environ:
exec_script_main = "from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()" % os.environ['SCONS_LIB_DIR']
else:
exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%s'), join(sys.prefix, 'scons-%s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % (self.scons_version, self.scons_version)
- exec_script_main_xml = string.replace(exec_script_main, "'", "&apos;")
-
- result = string.replace(input, r'<WORKPATH>', workpath)
- result = string.replace(result, r'<PYTHON>', python)
- result = string.replace(result, r'<SCONSCRIPT>', sconscript)
- result = string.replace(result, r'<SCONS_SCRIPT_MAIN>', exec_script_main)
- result = string.replace(result, r'<SCONS_SCRIPT_MAIN_XML>', exec_script_main_xml)
- result = string.replace(result, r'<PROJECT_GUID>', project_guid)
+ exec_script_main_xml = exec_script_main.replace("'", "&apos;")
+
+ result = input.replace(r'<WORKPATH>', workpath)
+ result = result.replace(r'<PYTHON>', python)
+ result = result.replace(r'<SCONSCRIPT>', sconscript)
+ result = result.replace(r'<SCONS_SCRIPT_MAIN>', exec_script_main)
+ result = result.replace(r'<SCONS_SCRIPT_MAIN_XML>', exec_script_main_xml)
+ result = result.replace(r'<PROJECT_GUID>', project_guid)
return result
def get_msvs_executable(self, version):
@@ -655,9 +654,9 @@ print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
else:
sconsflags = []
sconsflags = sconsflags + ['--warn=no-deprecated']
- os.environ['SCONSFLAGS'] = string.join(sconsflags)
+ os.environ['SCONSFLAGS'] = ' '.join(sconsflags)
try:
- result = apply(TestSCons.run, (self,)+args, kw)
+ result = TestSCons.run(self, *args, **kw)
finally:
os.environ['SCONSFLAGS'] = save_sconsflags or ''
return result