diff options
author | Steven Knight <knight@baldmt.com> | 2003-01-15 05:41:30 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-01-15 05:41:30 (GMT) |
commit | 284db25033af74d831c2e6c0f18c3e9415115705 (patch) | |
tree | 2d7f5c5c38fe6f5cfcce5fc25613150c8aefee20 /src/engine | |
parent | 64d27f9efc30088f70214b4585b83707c56f6c0a (diff) | |
download | SCons-284db25033af74d831c2e6c0f18c3e9415115705.zip SCons-284db25033af74d831c2e6c0f18c3e9415115705.tar.gz SCons-284db25033af74d831c2e6c0f18c3e9415115705.tar.bz2 |
Necessary changes towards supporting Jython.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/ActionTests.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/Platform/__init__.py | 22 | ||||
-rw-r--r-- | src/engine/SCons/Script/__init__.py | 6 |
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") |