summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-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
3 files changed, 23 insertions, 10 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py
index 134f8ae..1d57029 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 6401433..4987692 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 034bf73..487e45e 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")