summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/TestCmd.py8
-rw-r--r--etc/TestSCons.py4
-rw-r--r--runtest.py20
-rw-r--r--src/engine/SCons/ActionTests.py5
-rw-r--r--src/engine/SCons/Platform/__init__.py22
-rw-r--r--src/engine/SCons/Script/__init__.py6
-rw-r--r--test/AR.py2
-rw-r--r--test/ARFLAGS.py2
-rw-r--r--test/AS.py2
-rw-r--r--test/ASFLAGS.py2
-rw-r--r--test/Alias.py2
-rw-r--r--test/CC.py2
-rw-r--r--test/CFILESUFFIX.py2
-rw-r--r--test/CPPFLAGS.py2
-rw-r--r--test/CXX.py2
-rw-r--r--test/CXXFILESUFFIX.py2
-rw-r--r--test/Command.py2
-rw-r--r--test/CommandGenerator.py6
-rw-r--r--test/DVIPDF.py2
-rw-r--r--test/DVIPDFFLAGS.py2
-rw-r--r--test/DVIPS.py2
-rw-r--r--test/DVIPSFLAGS.py2
-rw-r--r--test/Default.py2
-rw-r--r--test/Depends.py2
-rw-r--r--test/ENV.py2
-rw-r--r--test/Environment.py2
-rw-r--r--test/F77.py2
-rw-r--r--test/F77FLAGS.py2
-rw-r--r--test/Ignore.py2
-rw-r--r--test/LATEX.py2
-rw-r--r--test/LATEXFLAGS.py2
-rw-r--r--test/LEX.py2
-rw-r--r--test/LEXFLAGS.py2
-rw-r--r--test/LINK.py2
-rw-r--r--test/LINKFLAGS.py2
-rw-r--r--test/PDFLATEX.py2
-rw-r--r--test/PDFLATEXFLAGS.py2
-rw-r--r--test/PDFTEX.py2
-rw-r--r--test/PDFTEXFLAGS.py2
-rw-r--r--test/ParseConfig.py4
-rw-r--r--test/Precious.py2
-rw-r--r--test/RANLIB.py2
-rw-r--r--test/RANLIBFLAGS.py2
-rw-r--r--test/Repository/no-repository.py2
-rw-r--r--test/SHCC.py2
-rw-r--r--test/SHCXX.py2
-rw-r--r--test/SHF77.py2
-rw-r--r--test/SHF77FLAGS.py2
-rw-r--r--test/SHLINK.py2
-rw-r--r--test/SHLINKFLAGS.py2
-rw-r--r--test/Scanner.py2
-rw-r--r--test/TAR.py2
-rw-r--r--test/TARFLAGS.py2
-rw-r--r--test/TEX.py2
-rw-r--r--test/TEXFLAGS.py2
-rw-r--r--test/YACC.py2
-rw-r--r--test/YACCFLAGS.py2
-rw-r--r--test/actions.py2
-rw-r--r--test/builderrors.py2
-rw-r--r--test/errors.py2
-rw-r--r--test/multiline.py2
-rw-r--r--test/option--.py2
-rw-r--r--test/option--D.py2
-rw-r--r--test/option--Q.py2
-rw-r--r--test/option--U.py2
-rw-r--r--test/option--debug.py2
-rw-r--r--test/option--max-drift.py2
-rw-r--r--test/option-c.py2
-rw-r--r--test/option-i.py2
-rw-r--r--test/option-j.py2
-rw-r--r--test/option-k.py2
-rw-r--r--test/option-n.py2
-rw-r--r--test/option-q.py2
-rw-r--r--test/option-s.py2
-rw-r--r--test/option-u.py2
-rw-r--r--test/overrides.py2
-rw-r--r--test/scan-once.py1
-rw-r--r--test/special-filenames.py2
-rw-r--r--test/up-to-date.py2
79 files changed, 124 insertions, 92 deletions
diff --git a/etc/TestCmd.py b/etc/TestCmd.py
index bac0a93f..6d6db737 100644
--- a/etc/TestCmd.py
+++ b/etc/TestCmd.py
@@ -229,6 +229,14 @@ def match_re_dotall(lines = None, res = None):
if re.compile("^" + res + "$", re.DOTALL).match(lines):
return 1
+if os.name == 'java':
+
+ python_executable = os.path.join(sys.prefix, 'jython')
+
+else:
+
+ python_executable = sys.executable
+
if sys.platform == 'win32':
def where_is(file, path=None, pathext=None):
diff --git a/etc/TestSCons.py b/etc/TestSCons.py
index 4b392d47..219046b9 100644
--- a/etc/TestSCons.py
+++ b/etc/TestSCons.py
@@ -22,6 +22,8 @@ import sys
import TestCmd
+python = TestCmd.python_executable
+
class TestFailed(Exception):
def __init__(self, args=None):
self.args = args
@@ -82,7 +84,7 @@ class TestSCons(TestCmd.TestCmd):
else:
kw['program'] = 'scons.py'
if not kw.has_key('interpreter') and not os.environ.get('SCONS_EXEC'):
- kw['interpreter'] = sys.executable
+ kw['interpreter'] = python
if not kw.has_key('match'):
kw['match'] = TestCmd.match_exact
if not kw.has_key('workdir'):
diff --git a/runtest.py b/runtest.py
index ae451857..52e76d48 100644
--- a/runtest.py
+++ b/runtest.py
@@ -36,6 +36,8 @@
# is intended for use in the batch_test_command
# field in the Aegis project config file.
#
+# -P Python Use the specified Python interpreter.
+#
# -p package Test against the specified package.
#
# -q Quiet. By default, runtest.py prints the
@@ -72,10 +74,15 @@ scons = None
scons_exec = None
output = None
+if os.name == 'java':
+ python = os.path.join(sys.prefix, 'jython')
+else:
+ python = sys.executable
+
cwd = os.getcwd()
-if sys.platform == 'win32':
- lib_dir = os.path.join(sys.exec_prefix, "lib")
+if sys.platform == 'win32' or os.name == 'java':
+ lib_dir = os.path.join(sys.exec_prefix, "Lib")
else:
# The hard-coded "python" here is the directory name,
# not an executable, so it's all right.
@@ -88,6 +95,7 @@ Options:
-d, --debug Run test scripts under the Python debugger.
-h, --help Print this message and exit.
-o FILE, --output FILE Print test results to FILE (Aegis format).
+ -P Python Use the specified Python interpreter.
-p PACKAGE, --package PACKAGE
Test against the specified PACKAGE:
deb Debian
@@ -103,9 +111,9 @@ Options:
-x SCRIPT, --exec SCRIPT Test SCRIPT.
"""
-opts, args = getopt.getopt(sys.argv[1:], "adho:p:qXx:",
+opts, args = getopt.getopt(sys.argv[1:], "adho:P:p:qXx:",
['all', 'debug', 'help', 'output=',
- 'package=', 'quiet', 'exec='])
+ 'package=', 'python=', 'quiet', 'exec='])
for o, a in opts:
if o == '-a' or o == '--all':
@@ -119,6 +127,8 @@ for o, a in opts:
if not os.path.isabs(a):
a = os.path.join(cwd, a)
output = a
+ elif o == '-P' or o == '--python':
+ python = a
elif o == '-p' or o == '--package':
package = a
elif o == '-q' or o == '--quiet':
@@ -314,7 +324,7 @@ class Unbuffered:
sys.stdout = Unbuffered(sys.stdout)
for t in tests:
- cmd = string.join([sys.executable, debug, t.abspath], " ")
+ cmd = string.join([python, debug, t.abspath], " ")
if printcmd:
sys.stdout.write(cmd + "\n")
s = os.system(cmd)
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py
index 134f8aea..1d57029a 100644
--- a/src/engine/SCons/ActionTests.py
+++ b/src/engine/SCons/ActionTests.py
@@ -96,7 +96,10 @@ class Environment:
def items(self):
return self.d.items()
-python = sys.executable
+if os.name == 'java':
+ python = os.path.join(sys.prefix, 'jython')
+else:
+ python = sys.executable
class ActionTestCase(unittest.TestCase):
diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py
index 6401433e..49876923 100644
--- a/src/engine/SCons/Platform/__init__.py
+++ b/src/engine/SCons/Platform/__init__.py
@@ -57,7 +57,10 @@ def platform_default():
files. Since we're architecture independent, though, we don't
care about the machine architecture.
"""
- if os.name == 'posix':
+ osname = os.name
+ if osname == 'java':
+ osname = os._osType
+ if osname == 'posix':
if sys.platform == 'cygwin':
return 'cygwin'
return 'posix'
@@ -75,14 +78,17 @@ def platform_module(name = platform_default()):
"""
full_name = 'SCons.Platform.' + name
if not sys.modules.has_key(full_name):
- try:
- file, path, desc = imp.find_module(name,
+ if os.name == 'java':
+ eval(full_name)
+ else:
+ try:
+ file, path, desc = imp.find_module(name,
sys.modules['SCons.Platform'].__path__)
- imp.load_module(full_name, file, path, desc)
- except ImportError:
- raise SCons.Errors.UserError, "No platform named '%s'" % name
- if file:
- file.close()
+ imp.load_module(full_name, file, path, desc)
+ except ImportError:
+ raise SCons.Errors.UserError, "No platform named '%s'" % name
+ if file:
+ file.close()
return sys.modules[full_name]
def DefaultToolList(platform, env):
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index 034bf73a..487e45ee 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -440,7 +440,11 @@ class OptParser(OptionParser):
def opt_debug(option, opt, value, parser):
if value == "pdb":
- args = [ sys.executable, "pdb.py" ] + \
+ if os.name == 'java':
+ python = os.path.join(sys.prefix, 'jython')
+ else:
+ python = sys.executable
+ args = [ python, "pdb.py" ] + \
filter(lambda x: x != "--debug=pdb", sys.argv)
if sys.platform == 'win32':
args[1] = os.path.join(sys.prefix, "lib", "pdb.py")
diff --git a/test/AR.py b/test/AR.py
index bd470055..f6ac5ce9 100644
--- a/test/AR.py
+++ b/test/AR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/ARFLAGS.py b/test/ARFLAGS.py
index 5e1b365e..36c5cd4c 100644
--- a/test/ARFLAGS.py
+++ b/test/ARFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/AS.py b/test/AS.py
index b25a1b62..a45cfaf2 100644
--- a/test/AS.py
+++ b/test/AS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/ASFLAGS.py b/test/ASFLAGS.py
index 2bfecf56..8ed6987c 100644
--- a/test/ASFLAGS.py
+++ b/test/ASFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/Alias.py b/test/Alias.py
index 97586937..ef69670e 100644
--- a/test/Alias.py
+++ b/test/Alias.py
@@ -29,7 +29,7 @@ import sys
import TestSCons
import TestCmd
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons(match=TestCmd.match_re)
diff --git a/test/CC.py b/test/CC.py
index 2028f3d2..4f1083a3 100644
--- a/test/CC.py
+++ b/test/CC.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/CFILESUFFIX.py b/test/CFILESUFFIX.py
index c5eb6cba..fc5363c7 100644
--- a/test/CFILESUFFIX.py
+++ b/test/CFILESUFFIX.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/CPPFLAGS.py b/test/CPPFLAGS.py
index 7b272331..9f7b9ee2 100644
--- a/test/CPPFLAGS.py
+++ b/test/CPPFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/CXX.py b/test/CXX.py
index e3a78a03..cc089e6e 100644
--- a/test/CXX.py
+++ b/test/CXX.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/CXXFILESUFFIX.py b/test/CXXFILESUFFIX.py
index e1582405..543fc1fc 100644
--- a/test/CXXFILESUFFIX.py
+++ b/test/CXXFILESUFFIX.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/Command.py b/test/Command.py
index 557b34e8..772d7db9 100644
--- a/test/Command.py
+++ b/test/Command.py
@@ -27,7 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/CommandGenerator.py b/test/CommandGenerator.py
index c708d155..643e5e6f 100644
--- a/test/CommandGenerator.py
+++ b/test/CommandGenerator.py
@@ -28,7 +28,7 @@ import os.path
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
@@ -44,7 +44,7 @@ sys.exit(0)
test.write('SConstruct', """
def g(source, target, for_signature, env):
import sys
- python = sys.executable
+ python = r"%s"
return [[python, "build.py", "$TEMPFILE"] + source,
[python, "build.py"] + target + ["$TEMPFILE"]]
@@ -54,7 +54,7 @@ env = Environment(BUILDERS = { 'b' : b },
env.b(target = 'foo1.out', source = 'foo1.in')
env.b(target = 'foo2.out', source = 'foo2.in')
env.b(target = 'foo3.out', source = 'foo3.in')
-""")
+""" % python)
test.write('foo1.in', "foo1.in\n")
diff --git a/test/DVIPDF.py b/test/DVIPDF.py
index 26b6b941..3df22e77 100644
--- a/test/DVIPDF.py
+++ b/test/DVIPDF.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/DVIPDFFLAGS.py b/test/DVIPDFFLAGS.py
index 15483608..fa6da6c6 100644
--- a/test/DVIPDFFLAGS.py
+++ b/test/DVIPDFFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/DVIPS.py b/test/DVIPS.py
index 9cb6d5f1..73e62a45 100644
--- a/test/DVIPS.py
+++ b/test/DVIPS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/DVIPSFLAGS.py b/test/DVIPSFLAGS.py
index a67a0586..8587022d 100644
--- a/test/DVIPSFLAGS.py
+++ b/test/DVIPSFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/Default.py b/test/Default.py
index 5f8aff8c..32faa991 100644
--- a/test/Default.py
+++ b/test/Default.py
@@ -28,7 +28,7 @@ import os
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/Depends.py b/test/Depends.py
index cb1fae14..b32162f7 100644
--- a/test/Depends.py
+++ b/test/Depends.py
@@ -27,7 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/ENV.py b/test/ENV.py
index cfaa1b9a..cbe8a1d4 100644
--- a/test/ENV.py
+++ b/test/ENV.py
@@ -27,7 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/Environment.py b/test/Environment.py
index 0f3ab8a7..76c0c8b3 100644
--- a/test/Environment.py
+++ b/test/Environment.py
@@ -27,7 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
import sys
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/F77.py b/test/F77.py
index 8e53fabe..49cacfec 100644
--- a/test/F77.py
+++ b/test/F77.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/F77FLAGS.py b/test/F77FLAGS.py
index 79469c49..5264bbb1 100644
--- a/test/F77FLAGS.py
+++ b/test/F77FLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/Ignore.py b/test/Ignore.py
index 0470d7ec..4d3080f4 100644
--- a/test/Ignore.py
+++ b/test/Ignore.py
@@ -27,7 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/LATEX.py b/test/LATEX.py
index 7aa81876..23cc713a 100644
--- a/test/LATEX.py
+++ b/test/LATEX.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/LATEXFLAGS.py b/test/LATEXFLAGS.py
index a4419346..e8886a7c 100644
--- a/test/LATEXFLAGS.py
+++ b/test/LATEXFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/LEX.py b/test/LEX.py
index 28cbdec0..b43902a2 100644
--- a/test/LEX.py
+++ b/test/LEX.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/LEXFLAGS.py b/test/LEXFLAGS.py
index 169ae804..c9967702 100644
--- a/test/LEXFLAGS.py
+++ b/test/LEXFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/LINK.py b/test/LINK.py
index 5670bc83..6191da28 100644
--- a/test/LINK.py
+++ b/test/LINK.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/LINKFLAGS.py b/test/LINKFLAGS.py
index 1134250c..29029f6c 100644
--- a/test/LINKFLAGS.py
+++ b/test/LINKFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/PDFLATEX.py b/test/PDFLATEX.py
index b49ac89c..7025bbc0 100644
--- a/test/PDFLATEX.py
+++ b/test/PDFLATEX.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/PDFLATEXFLAGS.py b/test/PDFLATEXFLAGS.py
index 67e16275..c06757db 100644
--- a/test/PDFLATEXFLAGS.py
+++ b/test/PDFLATEXFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/PDFTEX.py b/test/PDFTEX.py
index 47fdc9d9..78e8535f 100644
--- a/test/PDFTEX.py
+++ b/test/PDFTEX.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/PDFTEXFLAGS.py b/test/PDFTEXFLAGS.py
index 34647df1..28e02d4d 100644
--- a/test/PDFTEXFLAGS.py
+++ b/test/PDFTEXFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/ParseConfig.py b/test/ParseConfig.py
index eaf78029..259a1ca0 100644
--- a/test/ParseConfig.py
+++ b/test/ParseConfig.py
@@ -46,7 +46,7 @@ print env['LIBPATH']
print env['LIBS']
print env['CCFLAGS']
print static_libs
-""" % (sys.executable, test_config))
+""" % (TestSCons.python, test_config))
test.write('SConstruct2', """
env = Environment(CPPPATH = [], LIBPATH = [], LIBS = [], CCFLAGS = '')
@@ -56,7 +56,7 @@ print env['LIBPATH']
print env['LIBS']
print env['CCFLAGS']
print static_libs
-""" % (sys.executable, test_config))
+""" % (TestSCons.python, test_config))
good_stdout = test.wrap_stdout(read_str = """\
['/usr/include/fum', 'bar']
diff --git a/test/Precious.py b/test/Precious.py
index e0f8c8fe..3260c825 100644
--- a/test/Precious.py
+++ b/test/Precious.py
@@ -28,7 +28,7 @@ import os
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/RANLIB.py b/test/RANLIB.py
index 04a084f1..d1cee999 100644
--- a/test/RANLIB.py
+++ b/test/RANLIB.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/RANLIBFLAGS.py b/test/RANLIBFLAGS.py
index 80aaf161..c1611dc7 100644
--- a/test/RANLIBFLAGS.py
+++ b/test/RANLIBFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/Repository/no-repository.py b/test/Repository/no-repository.py
index 8659c00f..430db266 100644
--- a/test/Repository/no-repository.py
+++ b/test/Repository/no-repository.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/SHCC.py b/test/SHCC.py
index 1d01663f..cf5d015b 100644
--- a/test/SHCC.py
+++ b/test/SHCC.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/SHCXX.py b/test/SHCXX.py
index e8fb2b3c..2288953a 100644
--- a/test/SHCXX.py
+++ b/test/SHCXX.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/SHF77.py b/test/SHF77.py
index b0bde911..5df2bdf6 100644
--- a/test/SHF77.py
+++ b/test/SHF77.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_obj = '.obj'
diff --git a/test/SHF77FLAGS.py b/test/SHF77FLAGS.py
index f9d729f8..87133979 100644
--- a/test/SHF77FLAGS.py
+++ b/test/SHF77FLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_obj = '.obj'
diff --git a/test/SHLINK.py b/test/SHLINK.py
index 2812afd1..b0d7128c 100644
--- a/test/SHLINK.py
+++ b/test/SHLINK.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
lib_ = ''
diff --git a/test/SHLINKFLAGS.py b/test/SHLINKFLAGS.py
index 2b4d60ab..86bceb0e 100644
--- a/test/SHLINKFLAGS.py
+++ b/test/SHLINKFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
lib_ = ''
diff --git a/test/Scanner.py b/test/Scanner.py
index 461f4148..42c9f685 100644
--- a/test/Scanner.py
+++ b/test/Scanner.py
@@ -27,7 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/TAR.py b/test/TAR.py
index fbfacf6b..d23c43a0 100644
--- a/test/TAR.py
+++ b/test/TAR.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/TARFLAGS.py b/test/TARFLAGS.py
index 583e2742..4c275d59 100644
--- a/test/TARFLAGS.py
+++ b/test/TARFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/TEX.py b/test/TEX.py
index a5f981ef..71ff753f 100644
--- a/test/TEX.py
+++ b/test/TEX.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/TEXFLAGS.py b/test/TEXFLAGS.py
index 075750c3..bade83a0 100644
--- a/test/TEXFLAGS.py
+++ b/test/TEXFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/YACC.py b/test/YACC.py
index 1df8cc54..40c97abc 100644
--- a/test/YACC.py
+++ b/test/YACC.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/YACCFLAGS.py b/test/YACCFLAGS.py
index ba382098..4de649a6 100644
--- a/test/YACCFLAGS.py
+++ b/test/YACCFLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
diff --git a/test/actions.py b/test/actions.py
index 84b123e4..4c3e22ff 100644
--- a/test/actions.py
+++ b/test/actions.py
@@ -27,7 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/builderrors.py b/test/builderrors.py
index 286b115e..6b0239cb 100644
--- a/test/builderrors.py
+++ b/test/builderrors.py
@@ -28,7 +28,7 @@ import os
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/errors.py b/test/errors.py
index a79ed6e1..924c0727 100644
--- a/test/errors.py
+++ b/test/errors.py
@@ -29,7 +29,7 @@ import TestSCons
import string
import sys
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons(match = TestCmd.match_re_dotall)
diff --git a/test/multiline.py b/test/multiline.py
index ba13516a..df0913c5 100644
--- a/test/multiline.py
+++ b/test/multiline.py
@@ -28,7 +28,7 @@ import os.path
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option--.py b/test/option--.py
index 039ce3a7..00fefaab 100644
--- a/test/option--.py
+++ b/test/option--.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option--D.py b/test/option--D.py
index 67517cd8..e391215f 100644
--- a/test/option--D.py
+++ b/test/option--D.py
@@ -28,7 +28,7 @@ import sys
import TestSCons
import os
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option--Q.py b/test/option--Q.py
index b89b0421..3030308c 100644
--- a/test/option--Q.py
+++ b/test/option--Q.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option--U.py b/test/option--U.py
index d700267b..f6546ed3 100644
--- a/test/option--U.py
+++ b/test/option--U.py
@@ -32,7 +32,7 @@ import TestSCons
test = TestSCons.TestSCons()
-python = sys.executable
+python = TestSCons.python
test.subdir('sub1', 'sub2', 'sub3')
diff --git a/test/option--debug.py b/test/option--debug.py
index e85ca5c1..4be24bbe 100644
--- a/test/option--debug.py
+++ b/test/option--debug.py
@@ -163,7 +163,7 @@ def num(match, line):
return float(re.match(match, line).group(1))
start_time = time.time()
-test.run(program=sys.executable, arguments='-c pass')
+test.run(program=TestSCons.python, arguments='-c pass')
overhead = time.time() - start_time
start_time = time.time()
diff --git a/test/option--max-drift.py b/test/option--max-drift.py
index fb289ebc..7e7384dc 100644
--- a/test/option--max-drift.py
+++ b/test/option--max-drift.py
@@ -32,7 +32,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option-c.py b/test/option-c.py
index 22523bdc..f406574a 100644
--- a/test/option-c.py
+++ b/test/option-c.py
@@ -28,7 +28,7 @@ import os.path
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option-i.py b/test/option-i.py
index 2e905e19..c7bd6100 100644
--- a/test/option-i.py
+++ b/test/option-i.py
@@ -28,7 +28,7 @@ import os.path
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option-j.py b/test/option-j.py
index b6e83963..edd95ab3 100644
--- a/test/option-j.py
+++ b/test/option-j.py
@@ -33,7 +33,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
try:
import threading
diff --git a/test/option-k.py b/test/option-k.py
index 3899f8ed..e80b446d 100644
--- a/test/option-k.py
+++ b/test/option-k.py
@@ -28,7 +28,7 @@ import os.path
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option-n.py b/test/option-n.py
index 274c49bf..8ecd3a70 100644
--- a/test/option-n.py
+++ b/test/option-n.py
@@ -41,7 +41,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option-q.py b/test/option-q.py
index c6f21317..4650c849 100644
--- a/test/option-q.py
+++ b/test/option-q.py
@@ -32,7 +32,7 @@ import TestSCons
test = TestSCons.TestSCons()
-python = sys.executable
+python = TestSCons.python
test.write('build.py', r"""
import sys
diff --git a/test/option-s.py b/test/option-s.py
index 450e994a..63682d2c 100644
--- a/test/option-s.py
+++ b/test/option-s.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
diff --git a/test/option-u.py b/test/option-u.py
index 5e00ea8d..c9044c26 100644
--- a/test/option-u.py
+++ b/test/option-u.py
@@ -31,7 +31,7 @@ import TestSCons
test = TestSCons.TestSCons()
-python = sys.executable
+python = TestSCons.python
test.subdir('sub1', 'sub2', 'sub3')
diff --git a/test/overrides.py b/test/overrides.py
index f535c975..46953d71 100644
--- a/test/overrides.py
+++ b/test/overrides.py
@@ -31,7 +31,7 @@ import sys
test = TestSCons.TestSCons()
-python = sys.executable
+python = TestSCons.python
test.write('SConstruct', """
env = Environment(LIBS=['a'])
diff --git a/test/scan-once.py b/test/scan-once.py
index c60e4d3d..8b2f90f0 100644
--- a/test/scan-once.py
+++ b/test/scan-once.py
@@ -43,7 +43,6 @@ import sys
import TestCmd
import TestSCons
-#test = TestSCons.TestSCons(match = TestCmd.match_re)
test = TestSCons.TestSCons()
test.subdir('simple',
diff --git a/test/special-filenames.py b/test/special-filenames.py
index 3f05fe3d..515803eb 100644
--- a/test/special-filenames.py
+++ b/test/special-filenames.py
@@ -68,7 +68,7 @@ test.write("SConstruct", """
env=Environment(BUILDERS = {'Build' : Builder(action = '%s cat.py $TARGET $SOURCE')})
%s
-""" % (sys.executable, string.join(map(buildFileStr, file_names), '\n')))
+""" % (TestSCons.python, string.join(map(buildFileStr, file_names), '\n')))
test.run(arguments='.')
diff --git a/test/up-to-date.py b/test/up-to-date.py
index ab5e6075..b2f8d737 100644
--- a/test/up-to-date.py
+++ b/test/up-to-date.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()