python=None argument still defaults to sys.executable. Use this to
reset the python value we interpolate into the expected files that we
generate after resetting the os.environ['PYTHON'] value.
git-svn-id: http://scons.tigris.org/svn/scons/trunk@3445
fdb21ef1-2011-0410-befe-
b5e4ea1792b1
def msvs_substitute(self, input, msvs_ver,
subdir=None, sconscript=None,
- python=sys.executable,
+ python=None,
project_guid=None):
if not hasattr(self, '_msvs_versions'):
self.msvs_versions()
if sconscript is None:
sconscript = self.workpath('SConstruct')
+ if python is None:
+ python = sys.executable
+
if project_guid is None:
project_guid = "{E5466E26-0003-F18B-8F8A-BCD76C86388D}"
# Test that running SCons with $PYTHON_ROOT in the environment
# changes the .vcproj output as expected.
os.environ['PYTHON_ROOT'] = 'xyzzy'
+python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
test.run(chdir='work1', arguments='Test.vcproj')
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
-
test.must_exist(test.workpath('work1', 'Test.vcproj'))
vcproj = test.read(['work1', 'Test.vcproj'], 'r')
expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work1', 'SConstruct',
assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
os.environ['PYTHON_ROOT'] = ''
+python = None
# Test that running SCons with $PYTHON_ROOT in the environment
# changes the .vcproj output as expected.
os.environ['PYTHON_ROOT'] = 'xyzzy'
+python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
test.run(chdir='work1', arguments='Test.vcproj')
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
-
test.must_exist(test.workpath('work1', 'Test.vcproj'))
vcproj = test.read(['work1', 'Test.vcproj'], 'r')
expect = test.msvs_substitute(expected_vcprojfile, '7.1', 'work1', 'SConstruct',
assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
os.environ['PYTHON_ROOT'] = ''
+python = None
# Test that running SCons with $PYTHON_ROOT in the environment
# changes the .vcproj output as expected.
os.environ['PYTHON_ROOT'] = 'xyzzy'
+python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
test.run(chdir='work1', arguments='Test.vcproj')
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
-
test.must_exist(test.workpath('work1', 'Test.vcproj'))
vcproj = test.read(['work1', 'Test.vcproj'], 'r')
expect = test.msvs_substitute(expected_vcprojfile, '8.0', 'work1', 'SConstruct',
assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
os.environ['PYTHON_ROOT'] = ''
+python = None