summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Platform
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-01-15 05:41:30 (GMT)
committerSteven Knight <knight@baldmt.com>2003-01-15 05:41:30 (GMT)
commit284db25033af74d831c2e6c0f18c3e9415115705 (patch)
tree2d7f5c5c38fe6f5cfcce5fc25613150c8aefee20 /src/engine/SCons/Platform
parent64d27f9efc30088f70214b4585b83707c56f6c0a (diff)
downloadSCons-284db25033af74d831c2e6c0f18c3e9415115705.zip
SCons-284db25033af74d831c2e6c0f18c3e9415115705.tar.gz
SCons-284db25033af74d831c2e6c0f18c3e9415115705.tar.bz2
Necessary changes towards supporting Jython.
Diffstat (limited to 'src/engine/SCons/Platform')
-rw-r--r--src/engine/SCons/Platform/__init__.py22
1 files changed, 14 insertions, 8 deletions
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):